Color recommendation method, device, computer equipment and storage medium
By obtaining the initial color difference, determining the color components to be adjusted and their adjustment values in the target color space, and adjusting multiple colors to be recommended for multiple times, solving the problems of single and unknown colors in traditional color matching methods, and achieving the accuracy of color recommendation and improving user satisfaction.
Patent Information
- Application Number
- CN202110313619.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-24
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2041-03-24
AI Technical Summary
When designers choose color matching for application interfaces, the existing technology is difficult to meet user needs. The colors generated by traditional color matching methods are relatively single and highly unknown, and it is impossible to accurately push the colors required by users.
By obtaining the initial color difference, determine the color components to be adjusted and their adjustment values in the target color space, and adjust multiple colors to be recommended to achieve accurate push of the color content.
The colors required by users are generated based on the initial color differences, meeting the designer's personalized needs, and improving the accuracy of color recommendations and user satisfaction.
Smart Images

Figure CN115129310B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a color recommendation method, apparatus, computer equipment, and storage medium. Background Art
[0002] With the development and popularization of Internet technology, a growing number of applications are available, allowing people to meet their various needs. Each application interface has its own unique color scheme, and designers face the daunting task of finding these color combinations from tens of thousands of available colors when developing applications.
[0003] Currently, when designers are matching colors for interfaces, they often generate colors by giving a color value and using corresponding color generation rules. However, this method does not allow users to control the generated colors and cannot meet user needs. Summary of the Invention
[0004] This application proposes a color recommendation method, apparatus, computer device and storage medium to improve the above-mentioned defects.
[0005] In a first aspect, an embodiment of the present application provides a color recommendation method, including: obtaining an initial color, the initial color including a first color and a second color; based on the difference between the first color and the second color, determining the color components to be adjusted of the first color and the second color in a target color space and the adjustment values corresponding to the color components to be adjusted; based on the adjustment values corresponding to the color components to be adjusted, performing multiple adjustments on the color components to be adjusted of at least one of the first color and the second color to obtain multiple colors to be recommended; and recommending and displaying the multiple colors to be recommended.
[0006] In a second aspect, embodiments of the present application further provide a color recommendation device, comprising: an initial color acquisition module, an adjustment value acquisition module, a recommended color acquisition module, and a recommendation display module. The initial color acquisition module is configured to acquire initial colors, which include a first color and a second color; the adjustment value acquisition module is configured to determine, based on the difference between the first color and the second color, the color components to be adjusted for the first color and the second color in a target color space and their corresponding adjustment values; the recommended color acquisition module is configured to perform multiple adjustments to the color components to be adjusted for at least one of the first color and the second color based on the adjustment values, to obtain multiple colors to be recommended; and the recommendation display module is configured to recommend and display the multiple colors to be recommended.
[0007] In one possible implementation, the first color and the second color each include multiple color components in the target color space. The adjustment value acquisition module is configured to: obtain the difference between the color component value of each color component of the first color and the color component value of the corresponding color component of the second color; use the color component for which the difference is not zero as the color component to be adjusted; and determine the adjustment value corresponding to the color component to be adjusted based on the difference corresponding to the color component to be adjusted.
[0008] In a possible implementation, the adjustment value acquisition module is configured to: acquire an absolute value of the difference corresponding to each color component to be adjusted as the adjustment value corresponding to each color component to be adjusted.
[0009] In a possible implementation, the adjustment value acquisition module is configured to: acquire an average value of the absolute values of the differences corresponding to all color components to be adjusted, and use the average value as the adjustment value corresponding to the color component to be adjusted.
[0010] In one possible embodiment, the first color and the second color each include multiple color components in the target color space. The recommended color acquisition module is configured to: determine an adjustment operation for the color component to be adjusted based on the adjustment value, the color component threshold of the target color space, and the color component to be adjusted of at least one of the first color and the second color, the adjustment operation including at least one of adding the adjustment value and subtracting the adjustment value; perform the adjustment operation on the color component to be adjusted multiple times, and use the color obtained after each adjustment operation as the recommended color until the absolute value of the difference between the color component value of the color component to be adjusted and the color component threshold is less than the adjustment value.
[0011] In one possible embodiment, the color component threshold includes a first threshold and a second threshold, and the first threshold is smaller than the second threshold. The recommended color acquisition module is used to: obtain the difference between the color component value of each color component to be adjusted and the first threshold as the first difference, and the difference between the second threshold and the color component value of each color component to be adjusted as the second difference; if the first difference corresponding to any color component to be adjusted is smaller than the adjustment value, then determine that the adjustment operation is to accumulate the adjustment value; if the second difference corresponding to any color component to be adjusted is smaller than the adjustment value, then determine that the adjustment operation is to subtract the adjustment value; if the first difference corresponding to each color component to be adjusted is greater than or equal to the adjustment value, and the second difference corresponding to each color component to be adjusted is greater than or equal to the adjustment value, then determine that the adjustment operation is to accumulate the adjustment value and subtract the adjustment value.
[0012] In one possible embodiment, the color component threshold includes a first threshold and a second threshold, the first threshold being less than the second threshold. If the adjustment operation is to accumulate the adjustment value and to subtract the adjustment value, the recommended color acquisition module is configured to: accumulate the corresponding adjustment value for each color component to be adjusted, using the color obtained after each accumulation as the color to be recommended, until the absolute value of the difference between the color component value of any color component to be adjusted and the second threshold is less than the corresponding adjustment value; and subtract the corresponding adjustment value for each color component to be adjusted, using the color obtained after each accumulation as the color to be recommended, until the difference between the color component value of any color component to be adjusted and the first threshold is less than the corresponding adjustment value.
[0013] In one possible implementation, the initial color acquisition module is configured to acquire the primary interface color of a first application as a first color, and the primary interface color of a second application as a second color. The recommendation display module is configured to use the plurality of to-be-recommended colors as the primary interface colors of a current application for recommendation display, where the current application is the application under design.
[0014] In one possible implementation, the initial color acquisition module is configured to acquire the primary interface color of a current application as a first color and an input second color, where the current application is an application under design. The recommendation display module is configured to display the plurality of recommended colors as control colors of the current application for recommendation.
[0015] In a third aspect, an embodiment of the present application provides a computer device comprising: one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the color recommendation method provided in the first aspect above.
[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored. The program code can be called by a processor to execute the color recommendation method provided in the first aspect above.
[0017] The solution provided by this application obtains initial colors, which include a first color and a second color. Based on the difference between the first and second colors, the solution determines the color components to be adjusted for the first and second colors in the target color space and the corresponding adjustment values for the color components to be adjusted. Then, based on the adjustment values corresponding to the color components to be adjusted, the solution performs multiple adjustments to the color components to be adjusted for at least one of the first and second colors to obtain multiple recommended colors. These multiple recommended colors are then recommended. Therefore, the recommended colors are generated based on the differences between the initial colors. By controlling the differences between the initial colors, users can obtain the colors they desire, achieving precise push of color content and meeting user needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 A schematic diagram showing an application scenario of an embodiment of the present application.
[0020] Figure 2 A flow chart of a color recommendation method according to an embodiment of the present application is shown.
[0021] Figure 3 A flow chart of a color recommendation method according to another embodiment of the present application is shown.
[0022] Figure 4 A grayscale schematic diagram of a color to be recommended provided in an embodiment of the present application is shown.
[0023] Figure 5 Another grayscale schematic diagram of the color to be recommended provided in an embodiment of the present application is shown.
[0024] Figure 6 A flow chart of a color recommendation method according to another embodiment of the present application is shown.
[0025] Figure 7 A schematic diagram of an interface provided in an embodiment of the present application is shown.
[0026] Figure 8 Another interface schematic diagram provided in an embodiment of the present application is shown.
[0027] Figure 9 A flow chart of a color recommendation method according to another embodiment of the present application is shown.
[0028] Figure 10 A block diagram of a color recommendation device according to an embodiment of the present application is shown.
[0029] Figure 11 4 is a block diagram of a computer device for executing a color recommendation method according to an embodiment of the present application.
[0030] Figure 12 It is a storage unit for storing or carrying program codes for implementing the color recommendation method according to an embodiment of the present application. DETAILED DESCRIPTION
[0031] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work fall within the scope of protection of the present application.
[0032] It should be noted that similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and should not be understood as indicating or implying relative importance.
[0033] With the development of the internet, a growing number of applications are appearing, each with its own unique color palette. Many applications share similar functionality, making it impossible to develop similar features from scratch due to labor and maintenance costs. To ensure the uniqueness of each application, designers must use unique color palettes when designing designs with similar functionality. Finding the right color palettes among 256*256*256 colors is a daunting task for designers.
[0034] In traditional color matching, the designer is given a color value and, using a fixed color generation rule, generates a series of color values based on that value. The designer then selects the desired color from this set. Typically, these color generation rules involve converting the given color value into the HSL color space using a specific method, then increasing or decreasing the H, S, and L positions by fixed percentages. For example, the hexadecimal color value #006eff is converted to the HSL value hsl(214, 100%, 50%). This, combined with warm and cool color grading, generates 10 colors (#d5e7ff, #aacfff, #7fb7ff, #559eff, #2a86ff, #006eff, #005adc, #0046b9, #003296, and #001e73).
[0035] However, the inventors discovered during their research that the traditional color matching method has fixed color generation rules and can only increase / decrease fixed percentages at the H, S, and L positions, resulting in relatively simple generated colors; and the generated colors are unknown. For example, multiple dark colors and multiple light colors of the same color can be generated, but the depth of the generated colors is unknown, which may not meet the needs of designers.
[0036] Therefore, in order to solve the above-mentioned defects, the embodiments of the present application provide a color recommendation method, apparatus, computer equipment and storage medium. By obtaining the initial color, the initial color includes a first color and a second color, and based on the difference between the first color and the second color, the color components to be adjusted of the first color and the second color in the target color space and the adjustment values corresponding to the color components to be adjusted are determined. Then, based on the adjustment values corresponding to the color components to be adjusted, the color components to be adjusted of at least one of the first color and the second color are adjusted multiple times to obtain multiple colors to be recommended, and then the multiple colors to be recommended are recommended. Therefore, the colors to be recommended are generated based on the differences between the initial colors. The user can obtain the color they need by controlling the differences between the initial colors, thereby achieving accurate push of color content and meeting user needs.
[0037] As an implementation method, the embodiment of the present application can be applied to a user terminal, that is, the user terminal can serve as the execution subject of the color recommendation method of the present application. Specifically, the execution subject can be an application installed in the user terminal, and the color recommendation process is executed by the user terminal.
[0038] As another implementation method, the embodiment of the present application can be applied to a server, and the server can serve as the executor of the color recommendation method of the present application. The color recommendation process is then executed by the server, and the server can obtain the initial color uploaded by the user terminal, generate the color to be recommended based on the initial color, and return the color to be recommended to the user terminal for display.
[0039] Figure 1 A schematic diagram of an implementation environment of a color recommendation method provided by an embodiment of the present application is shown. Figure 1 , the implementation environment includes a server 10 and a user terminal 20.
[0040] The user terminal 20 is connected to the server 10 via a wireless network or a wired network, and data can be exchanged between the server 10 and the user terminal 20. Optionally, the user terminal 20 can be a laptop computer, a desktop computer, a smart phone, a tablet computer, a smart watch, a smart speaker, etc., but is not limited thereto.
[0041] Optionally, server 10 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, distribution networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms, but is not limited to these.
[0042] Optionally, user terminal 20 generally refers to one of multiple user terminals. This embodiment of the present application uses user terminal 20 as an example. Those skilled in the art will appreciate that the number of user terminals may be greater or lesser. For example, there may be only one user terminal, or dozens, hundreds, or even more user terminals. In this case, other terminals may also be included in the implementation environment. This embodiment of the present application does not limit the number or device types of user terminals.
[0043] In one embodiment, the user terminal 20 may be a terminal used by a user, through which the user sends an initial color value to the server 10 to obtain multiple recommended colors from the server 10. In another embodiment, the user terminal 20 may also generate multiple recommended colors based on the initial color and recommend and display the multiple recommended colors. Specifically, in the embodiments of the present application, the execution entity of each method step in the embodiments of the present application is not limited.
[0044] After introducing the implementation environment of the embodiment of the present application, the application scenarios of the technical solutions provided by the embodiment of the present application are described below. The technical solutions provided by the embodiment of the present application can be applied in a variety of scenarios, for example, in the scenario of interface color recommendation during application design, for example, in the scenario of control color recommendation during application design, for example, in the scenario of color recommendation during clothing design, and for example, in the scenario of building color recommendation during architectural design, but the embodiment of the present application does not limit this.
[0045] In the scenario of interface color recommendation during application design, the designer can input initial colors including a first color and a second color. The computer device determines the color components to be adjusted of the first color and the second color in the target color space and the adjustment values corresponding to the color components to be adjusted based on the difference between the first color and the second color. Then, based on the adjustment values corresponding to the color components to be adjusted, the color components to be adjusted of at least one of the first color and the second color are adjusted multiple times to obtain multiple colors to be recommended, that is, multiple interface colors to be recommended. Then, the multiple colors to be recommended are recommended and displayed as interface colors, so that the designer can select the interface color he needs and design an application that he is satisfied with.
[0046] In the scenario of control color recommendation during application design, the designer can input initial colors including a first color and a second color. The computer device determines the color components to be adjusted of the first color and the second color in the target color space and the adjustment values corresponding to the color components to be adjusted based on the difference between the first color and the second color. Then, based on the adjustment values corresponding to the color components to be adjusted, the color components to be adjusted of at least one of the first color and the second color are adjusted multiple times to obtain multiple colors to be recommended, that is, multiple control colors to be recommended. The multiple colors to be recommended are then recommended and displayed as control colors so that the designer can select the control color he needs and design a satisfactory application.
[0047] In the scenario of color recommendation during clothing design, the designer can input initial colors including a first color and a second color. The computer device determines the color components to be adjusted of the first color and the second color in the target color space and the adjustment values corresponding to the color components to be adjusted based on the difference between the first color and the second color. Then, based on the adjustment values corresponding to the color components to be adjusted, the color components to be adjusted of at least one of the first color and the second color are adjusted multiple times to obtain multiple colors to be recommended, that is, multiple clothing colors to be recommended. Then, the multiple colors to be recommended are recommended and displayed as clothing colors so that the designer can select the clothing colors he needs and design clothing that he is satisfied with.
[0048] In the scenario of building color recommendation in architectural design, the designer can input initial colors including a first color and a second color. The computer device determines the color components to be adjusted of the first color and the second color in the target color space and the adjustment values corresponding to the color components to be adjusted based on the difference between the first color and the second color. Then, based on the adjustment values corresponding to the color components to be adjusted, the color components to be adjusted of at least one of the first color and the second color are adjusted multiple times to obtain multiple colors to be recommended, that is, multiple building colors to be recommended. Then, the multiple colors to be recommended are recommended and displayed as building colors so that the designer can select the building color he needs and design a building that he is satisfied with.
[0049] See also Figure 2 , Figure 2 A color recommendation method provided in an embodiment of the present application is shown. The execution subject of the method can be the above-mentioned server or the above-mentioned user terminal. Specifically, the method includes: S210 to S240.
[0050] Step S210: Acquire initial colors, where the initial colors include a first color and a second color.
[0051] In the embodiments of the present application, the initial color may be a color specified for generating a color to be recommended. The initial color may include at least a first color and a second color. Of course, the number of colors included in the initial color is not limited; for example, the initial color may include more than two colors. In the embodiments of the present application, the implementation process of the color recommendation method is mainly described as the initial color including the first color and the second color.
[0052] In some embodiments, the initial color may be a color value received by the user terminal. Optionally, the user terminal may display a color input interface; in the color input interface, the user may input the color value of the initial color, and accordingly, the user terminal may detect the user's input operation and obtain the color value of the initial color input by the user. In this embodiment, if the execution subject of the color recommendation method is the user terminal, then after obtaining the initial color, the user terminal may generate a color to be recommended based on the initial color, so as to recommend and display the color to be recommended; if the execution subject of the color recommendation method is the server, then the user terminal may send the color value of the obtained initial color to the server, and accordingly, the server may receive the color value of the initial color sent by the user terminal, and after generating a color to be recommended based on the initial color, recommend and display the color to be recommended. It should be understood that the initial color includes at least a first color and a second color. In the above method, the user terminal may obtain at least two colors as the initial color.
[0053] The color value may be a color value in any color space, for example, a HEX (hexadecimal) color value, an RGB color value, an HSL color value, etc., but is not limited thereto.
[0054] In other embodiments, because the user may not know the color value of a color and cannot directly enter the color value of the initial color, the user terminal can obtain an image of the corresponding color and identify the color value of the image to obtain the color value of the initial color. If the color recommendation method is performed by a user terminal, after obtaining the image, the user terminal identifies the color value of the image as the color value of the initial color, and then generates a color to be recommended based on the initial color, thereby recommending and displaying the color to be recommended. Of course, the user terminal can also send the image to a server to obtain the color value of the initial color obtained by the server after identifying the image. If the color recommendation method is performed by a server, the user terminal can send the obtained image to the server. Accordingly, the server can receive the image sent by the user terminal, identify the color value of the image as the color value of the initial color, and then generate a color to be recommended based on the initial color, thereby recommending and displaying the color to be recommended. It should be understood that the initial color includes at least a first color and a second color. In the above method, the user terminal can obtain at least two colors as the initial color.
[0055] Optionally, since the image used to obtain the initial color may be a pure color image (the image contains only one color) or may contain multiple colors, the user terminal can output a prompt message, which is used to prompt the user to input a pure color image, so that after obtaining the pure color image, the color value corresponding to the pure color image is identified as the color value of the initial color; when the image input by the user contains multiple colors, the identified multiple colors can also be displayed for the user to select the required initial color; when the image input by the user contains multiple colors, where different colors are distributed in different areas of the image, the image can be divided into multiple areas, and the size of the area can be composed of several pixels; the multiple divided areas are then output for the user to select one of the areas, and after obtaining the selected area, the color value of the area is identified as the color value of the initial color.
[0056] Of course, the method of obtaining the initial color may not be limited in the embodiment of the present application.
[0057] Step S220 : determining color components to be adjusted of the first color and the second color in a target color space and adjustment values corresponding to the color components to be adjusted based on the difference between the first color and the second color.
[0058] Among them, the target color space can be any color space. Optionally, the target color space can be RGB color space, HSL color space, RGBA color space, YUV color space, LAB color space, etc., and the specific color space may not be limited. The color component to be adjusted can be any color component in the target color space, the color component to be adjusted can be one of the color components in the target color space, or it can be multiple color components in the target color space. For example, if the target color space is RGB color space, the color component to be adjusted can be R (red) component, or it can be G (green) component and B (blue) component.
[0059] In an embodiment of the application, after obtaining the first color and the second color, the color component to be adjusted in the target color space and the adjustment value corresponding to the color component to be adjusted can be determined based on the difference between the first color and the second color, so as to adjust at least one of the first color and the second color to obtain the color to be recommended.
[0060] In some embodiments, the difference between each color component of the first color and the second color in the target color space can be determined, that is, the difference between each color component of the first color and the corresponding color component of the second color. Then, based on the determined differences, the color component to be adjusted and the adjustment value corresponding to the color component to be adjusted are determined. For example, if the target color space is an HSL color space, the difference between the color component H (hue) of the first color and the color component H of the second color, the difference between the color component S (saturation) of the first color and the color component S of the second color, and the difference between the color component L (brightness) of the first color and the color component L of the second color are determined. After determining the difference between each color component of the first color and the corresponding color component of the second color, the color component to be adjusted and the corresponding adjustment value can be determined based on the difference between each color component of the first color and the corresponding color component of the second color.
[0061] Optionally, a color component having a difference between the first color and the second color may be used as the color component to be adjusted, and an adjustment value of the color component to be adjusted may be determined according to the difference between the color component to be adjusted of the first color and the color component to be adjusted of the second color.
[0062] Optionally, after obtaining the difference between each color component of the first color and the corresponding color component of the second color, the color component whose difference is greater than a specified threshold can be used as the color component to be adjusted, and the adjustment value of the color component to be adjusted can be determined based on the difference between the color component to be adjusted of the first color and the color component to be adjusted of the second color.
[0063] Of course, the specific method of determining the color component to be adjusted and its corresponding adjustment value based on the difference between the first color and the second color is not limited.
[0064] Step S230: Based on the adjustment value corresponding to the color component to be adjusted, the color component to be adjusted of at least one of the first color and the second color is adjusted multiple times to obtain multiple colors to be recommended.
[0065] In an embodiment of the present application, after obtaining the color component to be adjusted and the adjustment value corresponding to the color component to be adjusted, the color component to be adjusted of at least one of the first color and the second color can be adjusted multiple times according to the adjustment value corresponding to the color component to be adjusted, and the color obtained after each adjustment is used as the color to be recommended, thereby obtaining multiple colors to be recommended.
[0066] In some embodiments, based on the adjustment value corresponding to the color component to be adjusted, the color component to be adjusted of at least one of the first color and the second color can be cumulatively adjusted and the adjustment value can be subtracted, and the color component value of the color component to be adjusted can be ensured to not exceed the color component value range of the target color space, and the new color obtained after each cumulative adjustment value and subtraction of the adjustment value is used as the color to be adjusted.
[0067] Optionally, after performing multiple adjustments to at least one of the first color and the second color as described above to obtain multiple colors to be recommended, if the number of colors to be recommended is greater than a specified number, some of the colors to be recommended can be screened out from the multiple colors to be recommended as the colors to be recommended for subsequent recommendation and display. As a method, in this case, the previous color to be adjusted or the next color to be adjusted can be taken from the two adjacent colors to be recommended to screen out the colors to be recommended for recommendation and display. For example, the colors obtained by multiple adjustments are sorted into A1, A2, A3, A4..., An in the order of adjustment, and then A1, A3, A5,...A(2m-1) can be taken as the colors to be recommended for recommendation and display, where n and m are positive integers.
[0068] Step S240: recommending and displaying the multiple colors to be recommended.
[0069] In an embodiment of the present application, after obtaining the colors to be recommended, multiple colors to be recommended can be recommended and displayed. If the execution subject of the color recommendation method is a user terminal, the user terminal can display the multiple colors to be recommended so that the user can select the color they want; if the execution subject of the color recommendation method is a server, the server can send the multiple colors to be recommended to the user terminal so that the user terminal can display the multiple colors to be recommended.
[0070] The color recommendation method provided in the embodiment of the present application determines the color components to be adjusted of the first color and the second color in the target color space and the adjustment values corresponding to the color components to be adjusted based on the difference between the first color and the second color. Then, based on the adjustment values corresponding to the color components to be adjusted, the color components to be adjusted of at least one of the first color and the second color are adjusted multiple times to obtain multiple colors to be recommended, and then the multiple colors to be recommended are recommended. Therefore, the colors to be recommended are generated based on the differences between the initial colors. Users can obtain the colors they need by controlling the differences between the initial colors, thereby achieving accurate push of color content and meeting user needs.
[0071] See also Figure 3 , Figure 3 A color recommendation method provided in an embodiment of the present application is shown. The execution subject of the method can be the above-mentioned server or the above-mentioned user terminal. Specifically, the method includes: S310 to S370.
[0072] Step S310: Acquire initial colors, where the initial colors include a first color and a second color.
[0073] In the embodiment of the present application, step S310 can refer to the contents of other embodiments and will not be repeated here.
[0074] Step S320: Obtain the difference between the color component value of each color component of the first color and the color component value of the corresponding color component of the second color.
[0075] In an embodiment of the present application, the first color and the second color both include multiple color components in the target color space. For example, when the target color space is an RGB color space, the first color and the second color both include a color component R, a color component G, and a color component B. After obtaining the initial color, when obtaining the difference between the first color and the second color in the initial color, the difference between the color component value of each color component of the first color and the color component value of the corresponding color component of the second color can be obtained to determine the color component to be adjusted and the adjustment value corresponding to the color component to be adjusted.
[0076] In some embodiments, when obtaining the difference between the color component value of each color component of the first color and the color component value of the corresponding color component of the second color, the first color and the second color can be converted into color values in the target color space. For example, if the first color has a hexadecimal color value of #006eff and the second color has a hexadecimal color value of #005adc, and the target color space is an RGB color space, the first color can be converted into rgb(0,110,255), i.e., R=0, G=110, B=255, and the second color can be converted into rgb(0,90,255), i.e., R=0, G=90, B=255.
[0077] After determining the color values of the first color and the second color in the target color space, the difference between the color component value of each color component of the first color and the corresponding color component in the multiple color components of the second color can be calculated. That is, for each color component, the color component value corresponding to the first color is subtracted from the color component value of the second color to obtain the difference corresponding to each color component. For example, if the target color space is an RGB color space, the first color is rgb(0,110,255), and the second color is rgb(0,90,255), then for color component R, the difference between the two is 0, for color component G, the difference between the two is 20, and for color component B, the difference between the two is 0.
[0078] Step S330: taking the color component whose difference is not 0 as the color component to be adjusted.
[0079] In an embodiment of the present application, after determining the difference between the color component value of each color component of the first color and the color component value of the corresponding color component of the second color, it can be determined whether the difference corresponding to each color component is 0; based on the judgment result, the color component whose obtained difference is not 0 is determined, and the color component whose obtained difference is not 0 is used as the color component to be adjusted.
[0080] Step S340: determining an adjustment value corresponding to the color component to be adjusted based on the difference value corresponding to the color component to be adjusted.
[0081] In the embodiment of the present application, after the color component to be adjusted is determined, the adjustment value corresponding to the color component to be adjusted can be determined according to the difference corresponding to the color component to be adjusted determined above.
[0082] As an implementation method, the absolute value of the difference corresponding to each color component to be adjusted can be obtained as the adjustment value corresponding to each color component to be adjusted. Among them, for each color component to be adjusted, the adjustment value corresponding to the color component to be adjusted is the difference corresponding to the color component to be adjusted, that is, the adjustment value corresponding to each color component to be adjusted corresponds to the above difference corresponding to it. Exemplarily, the target color space is the RGB color space, the first color is rgb(0,110,255), and the second color is rgb(0,90,255). For color component R, the difference between the two is 0, for color component G, the difference between the two is 20, and for color component B, the difference between the two is 0; it can be determined that the color component to be adjusted is G, and the difference corresponding to G is 20, so the adjustment value is 20. By determining the adjustment value corresponding to the color component to be adjusted in this way, it is possible to obtain the recommended color based on the precise difference between the first color and the second color.
[0083] As another implementation, the average of the absolute values of the differences corresponding to all color components to be adjusted can be obtained and used as the adjustment value for the color component to be adjusted. In this implementation, after determining the color component to be adjusted, there may be multiple color components to be adjusted. In this case, since some of the multiple color components to be adjusted may have smaller or larger differences, the subsequent generation of recommended colors may result in a larger or smaller number of recommended colors. For example, if the target color space is the RGB color space and the difference corresponding to the color component to be adjusted is 60, if this is used as the adjustment value, then since the color value range of the RGB color space is 0-255, a maximum of four adjustments can be made, resulting in a smaller number of colors to be adjusted. Therefore, the average of the absolute values of the differences corresponding to all color components to be adjusted can be taken and used as the adjustment value for the color component to be adjusted. It is understood that if there is only one color component to be adjusted, the adjustment value for that color component to be adjusted is the corresponding difference above; if there are multiple color components to be adjusted, the adjustment value for each color component to be adjusted is the average of the absolute values of the differences corresponding to all color components to be adjusted. Exemplarily, the target color space is RGB. If the first color is hexadecimal #006eff and the second color is #005ae1, the color value of the first color in the target color space is rgb(0,110,255), and the color value of the second color in the target color space is rgb(0,90,225). The color components to be adjusted are color component G and color component B. The difference corresponding to color component G is 20, and the difference corresponding to color component B is 30. The average value of the difference corresponding to color component G and the difference corresponding to color component B is 25, and 25 is used as the adjustment value of color component G and color component B.
[0084] As another embodiment, if the difference value corresponding to the color component to be adjusted is too large or too small, directly using it as the adjustment value for the color component to be adjusted may result in more or fewer recommended colors being generated. For example, if the target color space is an RGB color space and the difference value corresponding to the color component to be adjusted is 60, if this is used as the adjustment value, then since the color value range of the RGB color space is 0 to 255, it can be adjusted at most four times, resulting in fewer colors to be adjusted. Therefore, a third threshold and a fourth threshold can be set for the difference value, wherein the third threshold is less than the fourth threshold. If the difference value corresponding to the color component to be adjusted is less than the third threshold, the adjustment value of the color component to be adjusted can be determined as the third threshold; if the difference value corresponding to the color component to be adjusted is greater than the fourth threshold, the adjustment value of the color component to be adjusted can be determined as the fourth threshold. The specific values of the third and fourth thresholds can be determined according to the target color space. For example, if the target color space is an RGB color space, the third threshold can be 20 and the fourth threshold can be 50. Of course, the above is only an example and does not constitute a limitation on the third and fourth thresholds.
[0085] Optionally, the above-mentioned embodiments can also be combined. After determining the color component to be adjusted, it can be determined whether the difference corresponding to the color component to be adjusted is less than the third threshold, or greater than the fourth threshold. If the difference corresponding to the color component to be adjusted is less than the third threshold, or greater than the fourth threshold, the absolute value of the difference of all color components to be adjusted can be taken, and the average value can be calculated, and the average value can be used as the adjustment value corresponding to each color component to be adjusted.
[0086] Step S350: Based on the adjustment value, the color component threshold of the target color space, and the color component to be adjusted of at least one of the first color and the second color, determine an adjustment operation for the color component to be adjusted, wherein the adjustment operation includes at least one of adding the adjustment value and subtracting the adjustment value.
[0087] In the embodiment of the present application, since the color space has a threshold range for color components, for example, in the RGB color space, the value range corresponding to each color component is 0 to 255, and when adjusting at least one of the first color and the second color according to the adjustment value, the color component value cannot exceed this range. Therefore, after determining the color component to be adjusted and the adjustment value corresponding to the color component to be adjusted, the adjustment operation for the color component to be adjusted can be determined based on the adjustment value, the color component threshold of the target color space, and the color component to be adjusted of at least one of the first color and the second color. The adjustment operation includes at least one of an accumulated adjustment value and a accumulated subtracted adjustment value, that is, the adjustment operation can be an accumulated adjustment value, a accumulated subtracted adjustment value, or both an accumulated adjustment value and a accumulated subtracted adjustment value.
[0088] In some embodiments, the color component threshold includes a first threshold and a second threshold, where the first threshold is less than the second threshold. That is, the first threshold is the minimum value of the value range of the color component in the target color space, and the second threshold is the maximum value of the value range of the color component in the target color space. When determining the adjustment operation for the color component to be adjusted, step S350 may include:
[0089] Obtain the difference between the color component value of each color component to be adjusted and the first threshold as the first difference, and the difference between the second threshold and the color component value of each color component to be adjusted as the second difference; if the first difference corresponding to any color component to be adjusted is less than the adjustment value, determine that the adjustment operation is to accumulate the adjustment value; if the second difference corresponding to any color component to be adjusted is less than the adjustment value, determine that the adjustment operation is to subtract the adjustment value; if the first difference corresponding to each color component to be adjusted is greater than or equal to the adjustment value, and the second difference corresponding to each color component to be adjusted is greater than or equal to the adjustment value, determine that the adjustment operation is to accumulate the adjustment value and subtract the adjustment value.
[0090] Among them, if the first difference value corresponding to any color component to be adjusted is less than the adjustment value, if the adjustment value is subtracted, the color component value of the color component to be adjusted will be less than the first threshold value, which means it exceeds the range of the color component value of the target color space. Therefore, the adjustment operation at this time is only the operation of adding the adjustment value; if the second difference value corresponding to any color component to be adjusted is less than the adjustment value, if the adjustment value is added, the color component value of the color component to be adjusted will be greater than the second threshold value, which means it exceeds the range of the color component value of the target color space. Therefore, the adjustment operation at this time is only the operation of subtracting the adjustment value; if the first difference value corresponding to each color component to be adjusted is greater than or equal to the adjustment value, and the second difference value corresponding to each color component to be adjusted is greater than or equal to the adjustment value, then adding or subtracting the adjustment value based on the original color component value of the color component to be adjusted will not exceed the range of the color component value of the target color space. Therefore, the adjustment operation at this time can simultaneously include adding and subtracting the adjustment value.
[0091] For example, the target color space is RGB. If the first color is hexadecimal #006eff and the second color is #005ae1, the color value of the first color in the target color space is rgb(0,110,255), and the color value of the second color in the target color space is rgb(0,90,225). The color components to be adjusted are color component G and color component B. The difference corresponding to color component G is 20, and the difference corresponding to color component B is 30. The difference corresponding to each color component to be adjusted is used as its corresponding value. Adjustment value: If an adjustment operation is performed on the basis of the first color to obtain the recommended color, for the color component G, its corresponding adjustment value is 20, the calculated first difference is (110-0)=110, and the second difference is (255-110)=145; for the color component B, its corresponding adjustment value is 30, the calculated first difference is (255-0)=255, and the second difference is (255-255)=0; therefore, there is a second difference corresponding to the color component B that is less than the adjustment value (30), so the adjustment operation only reduces the adjustment value.
[0092] In some embodiments, if the initial color includes more than two colors, the color component to be adjusted and the adjustment value corresponding to the color component to be adjusted can also be obtained in the same manner as described above. For example, if the initial color includes a first color, a second color, and a third color, for each color component, the difference between the color component of the first color and the color component of the second color, the difference between the color component of the first color and the color component of the third color, and the difference between the color component of the second color and the color component of the third color can be obtained respectively; then, the average value of all the differences corresponding to each color component is obtained, and the color component with a non-zero average value is used as the color component to be adjusted, and the average value corresponding to the color component to be adjusted is used as the adjustment value.
[0093] Step S360: performing the adjustment operation on the color component to be adjusted multiple times, and using the color obtained after each adjustment operation as the color to be recommended, until the absolute value of the difference between the color component value of the color component to be adjusted and the color component threshold is less than the adjustment value.
[0094] In an embodiment of the present application, after determining the adjustment operation of the color component to be adjusted, multiple adjustment operations can be performed on the color component to be adjusted for at least one of the first color and the second color, and the color obtained after each adjustment operation is used as the recommended color until the absolute value of the difference between the color component value of the color component to be adjusted and the color component threshold is less than the adjustment value. Specifically, if the adjustment operation is cumulative adjustment value, the adjustment value is accumulated for the color component to be adjusted, and the color obtained after each accumulation is used as the color to be recommended, until the absolute value of the difference between the color component value of any color component to be adjusted and the second threshold is less than its corresponding adjustment value; if the adjustment operation is cumulative adjustment value, the adjustment value is accumulated for the color component to be adjusted, and the color obtained after each accumulation is used as the color to be recommended, until the absolute value of the difference between the color component value of any color component to be adjusted and the first threshold is less than its corresponding adjustment value; if the adjustment operation is cumulative adjustment value and cumulative adjustment value, the corresponding adjustment value is accumulated for the color component to be adjusted, and the color obtained after each accumulation is used as the color to be recommended, until the absolute value of the difference between the color component value of any color component to be adjusted and the second threshold is less than its corresponding adjustment value, and the corresponding adjustment value is cumulatively subtracted from each color component to be adjusted, and the color obtained after each accumulation is used as the color to be recommended, until the difference between the color component value of any color component to be adjusted and the first threshold is less than its corresponding adjustment value. Among them, the operations of accumulating adjustment values and subtracting adjustment values are both performed on the basis of the original color component values of the color component to be adjusted. For example, if the second color rgb (0, 90, 225) is adjusted to generate the recommended color, the operations of accumulating adjustment values and subtracting adjustment values are both performed on the basis of 90 and 225.
[0095] In some embodiments, there may be multiple color components to be adjusted. When the adjustment operation is cumulative adjustment value and cumulative adjustment value subtraction, the corresponding adjustment value of each color component to be adjusted can be accumulated, and the color obtained after each accumulation is used as the color to be recommended, until the absolute value of the difference between the color component value of any color component to be adjusted and the second threshold is less than its corresponding adjustment value; and the corresponding adjustment value of each color component to be adjusted can be subtracted, and the color obtained after each accumulation is used as the color to be recommended, until the difference between the color component value of any color component to be adjusted and the first threshold is less than its corresponding adjustment value.
[0096] For example, the target color space is RGB. If the first color is hexadecimal #006eff and the second color is #005adc, the color value of the first color in the target color space is rgb(0,110,255), and the color value of the second color in the target color space is rgb(0,90,255), then the color component to be adjusted only includes the color component G, and the adjustment value is 20. If an adjustment operation is performed on the color component to be adjusted based on the first color, the adjustment operation includes accumulating the adjustment value and subtracting the adjustment value. Integer value; when accumulating the adjustment value, based on the original color component value of the first color, for the color component G, add 110+20 to get 130, and obtain the color rgb(0,130,255), then add 130+20 to get 150, and obtain the color rgb(0,150,255), and repeat this process until the color rgb(0,250,255) is obtained. At this time, the absolute value of the difference between the color component G and the second threshold value is already less than the adjustment value (20), so the accumulation operation can no longer be performed; Perform cumulative subtraction adjustment value. Based on the original color component value of the second color, for color component G, subtract 110-20 to get 90, and obtain the color rgb(0,90,255). Then subtract 90-20 to get 70, and obtain the color rgb(0,70,255). Repeat this until the color rgb(0,10,255) is obtained. At this time, the difference between color component G and the first threshold is less than the adjustment value, and the cumulative subtraction operation can no longer be performed. At this time, all colors are obtained: rgb(0,10,2 55), rgb(0,30,255), rgb(0,50,255), rgb(0,70,255), rgb(0,90,255), rgb(0,110,255), rgb(0,130,255), rgb(0,150,255), rgb(0,170,255), rgb(0,190,255), rgb(0,210,255), rgb(0,230,255), and rgb(0,250,255).
[0097] For example, the target color space is RGB. If the first color is hexadecimal #006eff and the second color is #005ae1, the color value of the first color in the target color space is rgb(0,110,255), and the color value of the second color in the target color space is rgb(0,90,225), then the color components to be adjusted are color component G and color component B, the difference corresponding to color component G is 20, and the difference corresponding to color component B is 30. The difference corresponding to each color component to be adjusted is used as its corresponding adjustment value; if, based on the second color, the color to be adjusted is The adjustment operation is performed on the components, and the adjustment operation includes cumulative adjustment value and cumulative subtraction adjustment value; when the cumulative adjustment value is performed, based on the original color component value of the second color, for the color component G, 90 is added with 20 to obtain 110, and for the color component B, 225 is added with 30 to obtain 255, that is, the color rgb (0, 110, 255) is obtained. At this time, the absolute value of the difference between the color component B and the second threshold value is less than the adjustment value (30), so the cumulative operation can no longer be performed; then the cumulative adjustment value is performed, based on the original color component value of the second color, for the color component G, 90 minus 20, get 70, for color component B, 225 minus 30, get 195, that is, get the color rgb (0, 70, 195); for color component G, 70 minus 20, get 50, for color component B, 195 minus 30, get 165, that is, get the color rgb (0, 50, 165); for color component G, 50 minus 20, get 30, for color component B, 165 minus 30, get 135, that is, get the color rgb (0, 30, 135); for color component G, 30 minus 20, get 20, for color Component B, subtract 30 from 135 to get 105, that is, the color rgb(0, 10, 105) is obtained. At this time, the value corresponding to the color component B to be adjusted is 10, and the difference between it and the first threshold (10) is already less than the adjustment value (20) corresponding to the adjusted color component B. Therefore, the operation of subtracting the adjustment value is stopped; all the colors obtained are: rgb(0, 110, 255), rgb(0, 90, 225), rgb(0, 70, 195), rgb(0, 50, 165), rgb(0, 30, 135), and rgb(0, 10, 105), please refer to Figure 4 , which shows all the recommended colors generated; in addition, when designing an application, the interface color is usually set using hexadecimal colors, so, for example Figure 5 As shown, it can be converted to a hexadecimal color.
[0098] It is understandable that if the differences corresponding to the color components to be adjusted are directly used as the adjustment values, the differences between the color components to be adjusted corresponding to the generated recommended colors will be the same, and the resulting colors will be the same regardless of whether the adjustment is made to the first or second color. Therefore, the above adjustment operation can be performed on either the first or second color to obtain multiple recommended colors. In addition, if the color components to be adjusted include color components R, G, and B, the above adjustment process can be used.
[0099] Step S370: recommend and display the multiple colors to be recommended.
[0100] In the embodiment of the present application, step S370 can refer to the contents of other embodiments and will not be repeated here.
[0101] The color recommendation method provided in the embodiment of the present application determines the color component with the difference as the color component to be adjusted based on the difference between the first color and the second color in the initial color, determines the adjustment value corresponding to the color component to be adjusted based on the difference corresponding to the color component to be adjusted, and then, based on the adjustment value corresponding to the color component to be adjusted, adds or subtracts the adjustment value to the color component to be adjusted based on the initial color, thereby obtaining multiple colors to be recommended, and then recommends the multiple colors to be recommended. Therefore, the recommended colors are generated based on the differences between the initial colors. The user can obtain the color they want by controlling the differences between the initial colors, thereby achieving accurate push of color content and meeting the user's needs. In addition, the above differences used to generate the recommended colors are determined based on the differences between the various color components of the initial colors, which can accurately generate the recommended colors based on the differences between the initial colors.
[0102] See also Figure 6 , Figure 6 A color recommendation method provided in an embodiment of the present application is shown. The execution subject of the method can be the above-mentioned server or the above-mentioned user terminal. Specifically, the method includes: S410 to S440.
[0103] Step S410: Acquire the primary interface color of the first application as the first color, and the primary interface color of the second application as the second color.
[0104] In an embodiment of the present application, the color recommendation method can be applied to a scenario where a designer matches the interface color when designing an application. In this scenario, the primary interface color of the first application can be obtained as the first color, and the primary interface color of the second application can be obtained as the second color. In this way, the designer can input the interfaces of two applications of interest; after obtaining the interface of the first application and the interface of the second application, identify the primary interface color of the first application and the primary interface color of the second application, thereby obtaining the first color and the second color in the initial color, so as to generate a color to be recommended based on the primary interface color of the first application and the primary interface color of the second application, so as to obtain a color to be recommended related to the primary interface color of the first application and the primary interface color of the second application.
[0105] In some embodiments, see Figure 7 , an interface input interface A1 can be displayed, in which controls A2 and A3 can be detected. When an operation of control A2 or A3 is detected, an interface image of the first application or an interface image of the second application can be received as input; please refer to Figure 8 After receiving the input interface image, the interface image can be added to the interface A1 so that the user can confirm whether it is the interface image they want to input; when an operation on the control A4 is detected, the main color of the interface can be obtained as the initial color according to the received interface image, and the subsequent process can be performed to generate the color to be recommended.
[0106] Step S420 : determining color components to be adjusted of the first color and the second color in a target color space and adjustment values corresponding to the color components to be adjusted based on the difference between the first color and the second color.
[0107] Step S430: Based on the adjustment value corresponding to the color component to be adjusted, the color component to be adjusted of at least one of the first color and the second color is adjusted multiple times to obtain multiple colors to be recommended.
[0108] In the embodiment of the present application, step S420 and step S430 can refer to the contents of other embodiments and will not be repeated here.
[0109] Step S440: The plurality of colors to be recommended are respectively used as the main interface colors of the current application for recommendation display, where the current application is the application under design.
[0110] In an embodiment of the present application, the color recommendation method is applied to a scenario where a designer matches the interface color when designing an application. After obtaining multiple colors to be recommended, when recommending and displaying the multiple colors to be recommended, the recommended colors can be configured as the main interface color of the current application, and an interface preview image of the current application is generated for display. In this way, it is convenient for the designer to view the effect of the recommended colors applied to the main interface color of the current application, so that the designer can obtain the desired interface design effect.
[0111] In some implementations, since application interface colors are typically set in hexadecimal notation during application design, if the recommended color is not in hexadecimal notation, it can be converted to a hexadecimal notation to configure the recommended color as the primary interface color of the current application, generating a preview image of the current application interface. This also facilitates subsequent designers to configure the primary interface color of the application to a desired color.
[0112] The color recommendation method provided in the embodiment of the present application is applied to the scenario where designers match the interface colors when designing applications. It can obtain the interface main colors of the first application and the second application as the initial colors, and then generate multiple colors to be recommended based on the differences between the initial colors. The multiple colors to be recommended are recommended and displayed as the interface main colors of the current application. This not only realizes that the recommended colors are generated based on the differences between the initial colors, but also allows users to obtain the colors they need by controlling the differences between the initial colors, thereby achieving accurate push of color content, meeting user needs, and making it convenient for designers to obtain the interface design effects they want.
[0113] See also Figure 9 , Figure 9 A color recommendation method provided in an embodiment of the present application is shown. The execution subject of the method can be the above-mentioned server or the above-mentioned user terminal. Specifically, the method includes: S510 to S540.
[0114] S510: Obtaining a primary interface color of a current application as a first color and an input second color, wherein the current application is an application under design.
[0115] In embodiments of the present application, the color recommendation method can be applied to scenarios where designers are designing application interfaces and matching colors. In this scenario, there's also a need to distribute controls, and control colors are often related to the primary interface color. Therefore, the initial color can use the primary interface color of the current application as the first color. The second color can be another initial color input by the user, obtained by the user terminal.
[0116] S520: Determine, based on the difference between the first color and the second color, color components to be adjusted of the first color and the second color in a target color space and adjustment values corresponding to the color components to be adjusted.
[0117] S530: Based on the adjustment value corresponding to the color component to be adjusted, adjust the color component to be adjusted of at least one of the first color and the second color multiple times to obtain multiple colors to be recommended.
[0118] In the embodiment of the present application, step S520 and step S530 can refer to the contents of other embodiments and will not be repeated here.
[0119] S540: Using the multiple colors to be recommended as control colors of the current application for recommendation display.
[0120] In an embodiment of the present application, the color recommendation method is applied to a scenario where a designer matches the interface color when designing an application. After obtaining multiple colors to be recommended, when recommending and displaying the multiple colors to be recommended, the recommended colors can be configured as the control colors of the current application, and an interface preview image of the current application is generated for display. In this way, it is convenient for the designer to view the effect of the recommended colors applied to the control colors of the current application, so that the designer can obtain the desired interface design effect.
[0121] In some implementations, since applications are typically designed using hexadecimal colors, if the recommended colors are not hexadecimal, they can be converted to hexadecimal colors and configured as the control colors of the current application, generating a preview of the current application interface. This also facilitates subsequent designers to configure the control colors of the application to their desired colors.
[0122] The color recommendation method provided in the embodiment of the present application is applied to the scenario where designers match the interface colors when designing applications. It can obtain the main interface color of the current application and the input color as the initial color, and then generate multiple colors to be recommended based on the differences between the initial colors. The multiple colors to be recommended are recommended and displayed as the main interface colors of the current application. This not only realizes that the recommended colors are generated based on the differences between the initial colors, but also allows users to obtain the colors they need by controlling the differences between the initial colors, thereby achieving accurate push of color content, meeting user needs, and making it convenient for designers to obtain the interface design effects they want.
[0123] See also Figure 10, which shows a structural block diagram of a color recommendation device 400 provided in an embodiment of the present application. The color recommendation device 600 uses the above-mentioned computer device, and the color recommendation device 400 includes: an initial color acquisition module 610, an adjustment value acquisition module 620, a recommended color acquisition module 630, and a recommendation display module 640. The initial color acquisition module 610 is used to acquire initial colors, and the initial colors include a first color and a second color; the adjustment value acquisition module 620 is used to determine the color components to be adjusted of the first color and the second color in the target color space and their corresponding adjustment values based on the difference between the first color and the second color; the recommended color acquisition module 630 is used to adjust the color components to be adjusted of at least one of the first color and the second color multiple times based on the adjustment value to obtain multiple colors to be recommended; and the recommendation display module 640 is used to recommend and display the multiple colors to be recommended.
[0124] In one possible implementation, the first color and the second color each include multiple color components in the target color space. The adjustment value acquisition module 620 is configured to: obtain the difference between the color component value of each color component of the first color and the color component value of the corresponding color component of the second color; use the color component for which the difference is not zero as the color component to be adjusted; and determine the adjustment value corresponding to the color component to be adjusted based on the difference corresponding to the color component to be adjusted.
[0125] In a possible implementation, the adjustment value acquisition module 620 is configured to acquire an absolute value of the difference corresponding to each color component to be adjusted as the adjustment value corresponding to each color component to be adjusted.
[0126] In a possible implementation, the adjustment value acquisition module 620 is configured to: acquire an average value of the absolute values of the differences corresponding to all color components to be adjusted, and use the average value as the adjustment value corresponding to the color component to be adjusted.
[0127] In one possible embodiment, the first color and the second color each include multiple color components in the target color space. The recommended color acquisition module 630 is configured to: determine an adjustment operation for the color component to be adjusted based on the adjustment value, the color component threshold of the target color space, and the color component to be adjusted of at least one of the first color and the second color, the adjustment operation including at least one of adding the adjustment value and subtracting the adjustment value; perform the adjustment operation on the color component to be adjusted multiple times, and use the color obtained after each adjustment operation as the color to be recommended, until the absolute value of the difference between the color component value of the color component to be adjusted and the color component threshold is less than the adjustment value.
[0128] In one possible embodiment, the color component threshold includes a first threshold and a second threshold, and the first threshold is less than the second threshold. The recommended color acquisition module 630 is used to: obtain the difference between the color component value of each color component to be adjusted and the first threshold as the first difference, and the difference between the second threshold and the color component value of each color component to be adjusted as the second difference; if the first difference corresponding to any color component to be adjusted is less than the adjustment value, determine that the adjustment operation is to accumulate the adjustment value; if the second difference corresponding to any color component to be adjusted is less than the adjustment value, determine that the adjustment operation is to subtract the adjustment value; if the first difference corresponding to each color component to be adjusted is greater than or equal to the adjustment value, and the second difference corresponding to each color component to be adjusted is greater than or equal to the adjustment value, determine that the adjustment operation is to accumulate the adjustment value and subtract the adjustment value.
[0129] In one possible embodiment, the color component threshold includes a first threshold and a second threshold, and the first threshold is less than the second threshold. If the adjustment operation is to accumulate the adjustment value and to subtract the adjustment value, the recommended color acquisition module 630 is configured to: accumulate the corresponding adjustment value for each color component to be adjusted, and use the color obtained after each accumulation as the color to be recommended, until the absolute value of the difference between the color component value of any color component to be adjusted and the second threshold is less than the corresponding adjustment value; and subtract the corresponding adjustment value for each color component to be adjusted, and use the color obtained after each accumulation as the color to be recommended, until the difference between the color component value of any color component to be adjusted and the first threshold is less than the corresponding adjustment value.
[0130] In one possible implementation, the initial color acquisition module 610 is configured to acquire the primary interface color of a first application as a first color, and the primary interface color of a second application as a second color. The recommendation display module 640 is configured to display the plurality of recommended colors as the primary interface colors of a current application, where the current application is the application under design.
[0131] In one possible implementation, the initial color acquisition module 610 is configured to acquire the primary interface color of a current application as a first color, and an input second color, where the current application is an application under design. The recommendation display module 640 is configured to display the plurality of recommended colors as control colors of the current application for recommendation.
[0132] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0133] In several embodiments provided in this application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0134] In addition, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The above-mentioned integrated modules may be implemented in the form of hardware or software functional modules.
[0135] Figure 11 The following is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 100 can be a terminal or a server. The terminal can be a laptop computer, a desktop computer, a smart phone, a tablet computer, a smart watch, etc., but is not limited to these. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, distribution networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms, but is not limited to these.
[0136] The computer device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more programs are configured to execute the method as described in the aforementioned method embodiment.
[0137] The processor 110 may include one or more processing cores. The processor 110 utilizes various interfaces and circuits to connect various components within the computer device 100. It executes instructions, programs, code sets, or instruction sets stored in the memory 120, and accesses data stored in the memory 120 to perform various functions and process data within the computer device 100. Optionally, the processor 110 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 110 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem handles wireless communications. It is understood that the modem may not be integrated into the processor 110 and may be implemented separately via a communications chip.
[0138] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data created by the terminal 100 during use (such as a phone book, audio and video data, chat record data), etc.
[0139] Please refer to Figure 12 , which shows a block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 800 stores program code, which can be called by a processor to execute the method described in the above method embodiment.
[0140] The computer-readable storage medium 800 can be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 800 has storage space for program code 810 for executing any of the method steps described above. These program codes can be read from or written to one or more computer program products. The program code 810 can be compressed, for example, in a suitable form.
[0141] The present application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the color recommendation method described above.
[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A color recommendation method, characterized in that: The method comprises: Acquire an initial color, where the initial color includes a first color and a second color; the first color and the second color each include multiple color components in a target color space; determining, based on a difference between the first color and the second color, color components to be adjusted of the first color and the second color in the target color space and adjustment values corresponding to the color components to be adjusted; determining, based on the adjustment value, a color component threshold of the target color space, and a color component to be adjusted of at least one of the first color and the second color, an adjustment operation for the color component to be adjusted, the adjustment operation comprising at least one of accumulating the adjustment value and accumulating subtracting the adjustment value; performing the adjustment operation on the color component to be adjusted multiple times, and using the color obtained after each adjustment operation as the color to be recommended, until the absolute value of the difference between the color component value of the color component to be adjusted and the color component threshold value is less than the adjustment value, so as to obtain multiple colors to be recommended; The multiple colors to be recommended are recommended and displayed.
2. The method according to claim 1, characterized in that The determining, based on the difference between the first color and the second color, color components to be adjusted of the first color and the second color in the target color space and their corresponding adjustment values includes: Obtaining a difference between a color component value of each color component of the first color and a color component value of a corresponding color component of the second color; The color component whose difference is not 0 is used as the color component to be adjusted; An adjustment value corresponding to the color component to be adjusted is determined based on the difference corresponding to the color component to be adjusted.
3. The method according to claim 2, characterized in that The determining, based on the difference corresponding to the color component to be adjusted, the adjustment value corresponding to the color component to be adjusted includes: The absolute value of the difference corresponding to each color component to be adjusted is obtained as the adjustment value corresponding to each color component to be adjusted.
4. The method according to claim 2, characterized in that The determining, based on the difference corresponding to the color component to be adjusted, the adjustment value corresponding to the color component to be adjusted includes: An average value of the absolute values of the differences corresponding to all the color components to be adjusted is obtained, and the average value is used as the adjustment value corresponding to the color component to be adjusted.
5. The method according to claim 1, wherein The color component threshold includes a first threshold and a second threshold, the first threshold being smaller than the second threshold; determining an adjustment operation for the color component to be adjusted based on the adjustment value, the color component threshold of the target color space, and the color component to be adjusted of the at least one color, wherein the adjustment operation includes at least one of accumulating the adjustment value and accumulating the adjustment value, including: Obtaining a difference between the color component value of each to-be-adjusted color component and the first threshold as a first difference, and a difference between the second threshold and the color component value of each to-be-adjusted color component as a second difference; If the first difference corresponding to any color component to be adjusted is smaller than the adjustment value, determining that the adjustment operation is to accumulate the adjustment value; If the second difference value corresponding to any color component to be adjusted is smaller than the adjustment value, determining that the adjustment operation is to cumulatively subtract the adjustment value; If the first difference value corresponding to each color component to be adjusted is greater than or equal to the adjustment value, and the second difference value corresponding to each color component to be adjusted is greater than or equal to the adjustment value, then determining that the adjustment operation is to accumulate the adjustment value and subtract the adjustment value.
6. The method according to claim 1, characterized in that The color component threshold includes a first threshold and a second threshold, and the first threshold is less than the second threshold; if the adjustment operation is cumulative addition of the adjustment value and cumulative subtraction of the adjustment value, the color component to be adjusted is subjected to the adjustment operation multiple times, and a color obtained after each adjustment operation is used as a color to be recommended until the absolute value of the difference between the color component value of the color component to be adjusted and the color component threshold is less than the adjustment value, including: Accumulating the corresponding adjustment value for each color component to be adjusted, and using the color obtained after each accumulation as the color to be recommended, until the absolute value of the difference between the color component value of any color component to be adjusted and the second threshold value is less than the corresponding adjustment value; The corresponding adjustment value of each color component to be adjusted is cumulatively subtracted, and the color obtained after each cumulative subtraction is used as the color to be recommended, until the difference between the color component value of any color component to be adjusted and the first threshold is less than the corresponding adjustment value.
7. The method according to any one of claims 1 to 6, characterized in that The obtaining of the initial color includes: Obtaining the primary color of the interface of the first application as the first color, and the primary color of the interface of the second application as the second color; The recommending and displaying the plurality of colors to be recommended includes: The multiple colors to be recommended are respectively used as the main interface colors of the current application for recommendation display, and the current application is the application under design.
8. The method according to any one of claims 1 to 6, characterized in that The obtaining of the initial color includes: Obtaining a primary interface color of a current application as a first color and an input second color, wherein the current application is an application under design; The recommending and displaying the plurality of colors to be recommended includes: The multiple colors to be recommended are respectively used as the control colors of the current application for recommendation display.
9. A color recommendation device, characterized in that: The device includes: an initial color acquisition module, an adjustment value acquisition module, a recommended color acquisition module, and a recommendation display module, wherein: The initial color acquisition module is used to acquire an initial color, wherein the initial color includes a first color and a second color; the first color and the second color each include multiple color components in a target color space; The adjustment value acquisition module is used to determine the color components to be adjusted of the first color and the second color in the target color space and their corresponding adjustment values based on the difference between the first color and the second color; The recommended color acquisition module is used to determining, based on the adjustment value, the color component threshold of the target color space, and the color component to be adjusted of at least one of the first color and the second color, an adjustment operation for the color component to be adjusted, the adjustment operation comprising at least one of accumulating the adjustment value and accumulating the adjustment value; performing the adjustment operation on the color component to be adjusted multiple times, using a color obtained after each adjustment operation as a color to be recommended, until an absolute value of a difference between a color component value of the color component to be adjusted and the color component threshold is less than the adjustment value, thereby obtaining multiple colors to be recommended; The recommendation display module is used to recommend and display the multiple colors to be recommended.
10. A computer device, characterized in that: include: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, which can be called by a processor to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Animation compression method and device, animation display method and device, animation processing system and storage medium
CN111787386A