Color plate generation method and device, equipment and computer storage medium

By adjusting the brightness of the auxiliary color and the positioning of the gray scale, the color palette is ensured to be rich in color and high in distinction, solving the problems of insufficient color and low distinction in the prior art, and improving user experience.

CN118799415APending Publication Date: 2024-10-18CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311443477.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-01
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

In the existing technology, the color system selects general auxiliary colors by obtaining the parameters of the main color. The generated color palette is not rich enough in color and cannot guarantee the distinction of each color in the color palette, resulting in visual deviations for the user and affecting the user experience. .

Method used

By obtaining the parameters of the main color and the number of auxiliary colors, determine the auxiliary color, correct the auxiliary color according to the brightness, use the gray scale to locate the main color and auxiliary color, adjust their hue, saturation and lightness to make the depth of each auxiliary color The changes are uniform, generating rich and colorful color palettes of the same color, ensuring color differentiation.

Benefits of technology

The generated color palette is rich in color and highly differentiated, reducing user visual deviations and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799415A_ABST
    Figure CN118799415A_ABST
Patent Text Reader

Abstract

The invention discloses a color plate generation method and device, equipment and a computer storage medium. Obtaining a first parameter of a main color, a first preset number of first auxiliary colors and a gray scale; starting from the position of the main color, selecting a first preset number of first auxiliary colors on the hue ring, and obtaining second parameters of the first auxiliary colors; the second parameter is adjusted, the brightness of the main color and the brightness of the first auxiliary colors are calculated respectively, and a second auxiliary color with the minimum brightness difference with the main color in the first auxiliary colors and the main color serve as third auxiliary colors; calculating the gray value of the third auxiliary color; calculating a first difference value between the gray value of the third auxiliary color and the gray value corresponding to each brightness in the gray scale, and determining the positioning value corresponding to the first target brightness as the positioning value of the third auxiliary color; and adjusting the third hue, the third saturation and the third brightness to obtain a plurality of first color plates. Therefore, the colorful same-color color palette is generated, the distinction degree of each color is ensured, the visual deviation of a user is reduced, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and in particular, relates to a color palette generation method, device, equipment and computer storage medium. Background Art

[0002] In today's society where digital information is developing rapidly, various Internet products emerge in an endless stream, and having your own color system is very important for building a complete user experience system. A scientific and unified color system can better provide color guidelines for designers' interface design, and rich color design can improve user experience.

[0003] In the prior art, the color system is to obtain the parameters of the main color, select a common auxiliary color, and derive multiple color palettes from light to dark. The color palette generated in this way is not rich in color, and the distinction of each color in the color palette cannot be guaranteed, which leads to visual deviations in users and affects user experience. Summary of the invention

[0004] The embodiments of the present application provide a method, device, equipment and computer storage medium for generating a color palette, wherein the auxiliary color is determined by the parameters of the primary color and the number of auxiliary colors, and the auxiliary color is corrected according to the brightness; the primary color and the auxiliary color are positioned using a grayscale ruler, and the hue, saturation and lightness of the primary color and the auxiliary color are adjusted according to preset adjustment information and positioning values, so that the depth of each auxiliary color varies evenly, and a rich and colorful color palette of the same color system is generated, which ensures the distinction of each color, reduces the visual deviation of the user, and improves the user experience.

[0005] In a first aspect, an embodiment of the present application provides a method for generating a color palette, comprising:

[0006] Obtaining a first parameter of a primary color, a first preset number of first auxiliary colors, and a grayscale, wherein the first parameter includes a first hue, a first saturation, and a first lightness of the primary color, and the grayscale includes a lightness ladder, a grayscale value corresponding to each lightness in the lightness ladder, and a positioning value, wherein the number of positioning values ​​is a second preset number;

[0007] Starting from the position of the primary color, selecting a first preset number of first auxiliary colors on the color wheel, and obtaining second parameters of the first auxiliary colors, the second parameters including a second hue, a second saturation, and a second lightness;

[0008] Adjust the second parameter, and calculate the brightness of the primary color and the first auxiliary color respectively according to the relationship information of hue, saturation, lightness and brightness, and use the second auxiliary color and the primary color with the smallest brightness difference with the primary color in the first auxiliary color as the third auxiliary color;

[0009] Calculating the gray value of the third auxiliary color using the relationship information among the hue, saturation, brightness and gray value, and the third parameter of the third auxiliary color, where the third parameter includes the third hue, the third saturation and the third brightness;

[0010] Calculate the first difference between the gray value of the third auxiliary color and the gray value corresponding to each brightness in the grayscale, determine that the positioning value corresponding to the first target brightness is the positioning value of the third auxiliary color, and the first target brightness is the brightness corresponding to the smallest first difference;

[0011] According to the positioning value and the preset adjustment information, the third hue, the third saturation and the third brightness are adjusted to obtain multiple first color palettes, the multiple first color palettes include a color palette of the third auxiliary color and a color palette of the primary color, and each first color palette includes a second preset number of colors.

[0012] In a possible implementation, before selecting a first preset number of first auxiliary colors on the color wheel starting from the position of the primary color, the method further includes:

[0013] According to the first parameter, determine the position of the main color on the color wheel;

[0014] According to the first preset number, determining the angle interval for selecting the first auxiliary color on the color wheel;

[0015] Starting from the position of the primary color, a first preset number of first secondary colors are selected on the color wheel, including:

[0016] Starting from the position of the primary color on the hue wheel, select the first secondary color on the hue wheel according to the angle interval.

[0017] In a possible embodiment, adjusting the second parameter, and calculating the brightness of the primary color and the first auxiliary color respectively according to the relationship information of hue, saturation, brightness and brightness, and taking the second auxiliary color and the primary color in the first auxiliary color with the smallest brightness difference with the primary color as the third auxiliary color, including:

[0018] Determine the brightness of the primary color and the brightness of the first auxiliary color according to the relationship information of hue, saturation, lightness and brightness;

[0019] adjusting a second parameter of the first auxiliary color and calculating a second difference between the brightness of the primary color and the brightness of the first auxiliary color;

[0020] The first auxiliary color with the smallest second difference is used as the second auxiliary color, the primary color and the second auxiliary color are used as the third auxiliary color, and the third parameter of the third auxiliary color is determined;

[0021] Among them, the adjustment range of the second parameter is within a first preset range, and the third parameter includes a third hue, a third saturation and a third brightness.

[0022] In a possible implementation, adjusting the third hue, the third saturation, and the third brightness according to the positioning value and the preset adjustment information to obtain the first color palette includes:

[0023] According to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value and the hue, the third hue of the third auxiliary color is adjusted; according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value and the saturation, the third saturation of the third auxiliary color is adjusted; according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value, the brightness range and the brightness, the third brightness of the third auxiliary color is adjusted to obtain the first color palette.

[0024] In a possible embodiment, according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value and the hue, the third hue of the third auxiliary color is adjusted; according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value and the saturation, the third saturation of the third auxiliary color is adjusted; according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value, the brightness range and the brightness, the third brightness of the third auxiliary color is adjusted to obtain the first color palette, including:

[0025] Obtaining adjustment relationship information between positioning value and hue, adjustment relationship information between positioning value and saturation, and adjustment relationship information between positioning value, brightness range, and brightness;

[0026] In the adjustment relationship information of the positioning value and the hue, a first value range of the positioning value of the third auxiliary color and a value range of the third hue are determined, and third adjustment information corresponding to the first value range and the value range of the third hue is determined;

[0027] In the adjustment relationship information of the positioning value and the saturation, a second value range of the positioning value and a third value range of the saturation of the third auxiliary color are determined, and second adjustment information corresponding to the second value range and the third value range of the saturation is determined;

[0028] In the positioning value, brightness range and brightness adjustment relationship information, determine a third value range of the positioning value and a third brightness value range of the third auxiliary color, and determine third adjustment information corresponding to the third value range and the third brightness value range;

[0029] The third hue is adjusted according to the third adjustment information, the third saturation is adjusted according to the second adjustment information, and the third brightness is adjusted according to the third adjustment information to obtain the first color palette.

[0030] In a possible embodiment, it also includes:

[0031] Obtaining a colorless palette, the colorless palette including a second preset number of preset colors;

[0032] The transparency of the primary color palette is reduced to a preset threshold to obtain a target color palette;

[0033] The colorless color palette and the target color palette are superimposed to obtain a second color palette.

[0034] In a possible implementation, after adjusting the third hue, the third saturation, and the third brightness according to the positioning value and the preset adjustment information to obtain a plurality of first color palettes, the method further includes:

[0035] receiving a user's input for adjusting a target parameter of a first target color in a first color palette;

[0036] In response to the adjustment input, a parameter of the first target color is adjusted, the parameter of the first target color including hue, saturation or lightness.

[0037] In a possible embodiment, it also includes:

[0038] receiving a fourth parameter input by a user, where the fourth parameter includes a fourth hue, a fourth saturation, and a fourth brightness;

[0039] Calculate the similarity value between the parameter of the second target color in multiple first color palettes and the fourth parameter. When the similarity value between the target parameter and the fourth parameter is greater than a preset threshold, output the color corresponding to the target parameter. When the similarity value between the target parameter and the fourth parameter is not greater than the preset threshold, output the color corresponding to the fourth parameter.

[0040] In a second aspect, an embodiment of the present application provides a color palette generation device, including:

[0041] an acquisition module, configured to acquire a first parameter of a primary color, a first preset number of first auxiliary colors, and a grayscale scale, wherein the first parameter includes a first hue, a first saturation, and a first lightness of the primary color, and the grayscale scale includes a lightness ladder, a grayscale value corresponding to each lightness in the lightness ladder, and a positioning value, wherein the number of positioning values ​​is a second preset number;

[0042] A selection module, used to select a first preset number of first auxiliary colors on the color wheel starting from the position of the primary color, and obtain second parameters of the first auxiliary colors, where the second parameters include a second hue, a second saturation, and a second lightness;

[0043] an adjustment module, used to adjust the second parameter, and calculate the brightness of the primary color and the first auxiliary color respectively according to the relationship information of the hue, saturation, lightness and brightness, and use the second auxiliary color and the primary color in the first auxiliary color whose brightness difference with the primary color is the smallest as the third auxiliary color;

[0044] a calculation module, configured to calculate the gray value of the third auxiliary color by using the relationship information of the hue, saturation, brightness and gray value, and the third parameter of the third auxiliary color, wherein the third parameter includes the third hue, the third saturation and the third brightness;

[0045] A determination module, configured to calculate a first difference between the gray value of the third auxiliary color and the gray value corresponding to each brightness in the grayscale scale, determine that the positioning value corresponding to the first target brightness is the positioning value of the third auxiliary color, and the first target brightness is the brightness corresponding to the minimum first difference;

[0046] The adjustment module is also used to adjust the third hue, the third saturation and the third brightness according to the positioning value and the preset adjustment information to obtain multiple first color palettes, the multiple first color palettes include a color palette of the third auxiliary color and a color palette of the primary color, and each first color palette includes a second preset number of colors.

[0047] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising:

[0048] a processor and a memory storing computer program instructions;

[0049] When the processor executes the computer program instructions, any one of the above methods for generating a color palette is implemented.

[0050] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, any of the above-mentioned color palette generation methods is implemented.

[0051] In a fifth aspect, an embodiment of the present application provides a computer program product, characterized in that when instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to execute any of the above-mentioned methods for generating a color palette.

[0052] The color palette generation method, device, equipment and computer storage medium of the embodiment of the present application include: obtaining a first parameter of a primary color, a first preset number of first auxiliary colors and a grayscale, wherein the first parameter includes a first hue, a first saturation and a first lightness of the primary color, and the grayscale includes a lightness ladder, a grayscale value corresponding to each lightness in the lightness ladder and a positioning value, and the number of positioning values ​​is a second preset number; starting from the position of the primary color, selecting a first preset number of first auxiliary colors on the color wheel, and obtaining second parameters of the first auxiliary color, wherein the second parameters include a second hue, a second saturation and a second lightness; adjusting the second parameters, and calculating the brightness of the primary color and the first auxiliary color respectively according to the relationship information of the hue, saturation, lightness and lightness, and placing the grayscale value corresponding to the primary color in the first auxiliary color The second auxiliary color and the primary color with the smallest brightness difference are used as the third auxiliary color; the grayscale value of the third auxiliary color is calculated by using the relationship information of hue, saturation, brightness and grayscale value, and the third parameter of the third auxiliary color, the third parameter includes the third hue, the third saturation and the third brightness; the first difference between the grayscale value of the third auxiliary color and the grayscale value corresponding to each brightness in the grayscale scale is calculated, and the positioning value corresponding to the first target brightness is determined to be the positioning value of the third auxiliary color, and the first target brightness is the brightness corresponding to the smallest first difference; according to the positioning value and the preset adjustment information, the third hue, the third saturation and the third brightness are adjusted to obtain multiple first color palettes, the multiple first color palettes include the color palette of the third auxiliary color and the color palette of the primary color, and each first color palette includes a second preset number of colors. In this way, the auxiliary color is determined by the parameters of the primary color and the number of auxiliary colors, and the auxiliary color is corrected according to the brightness; the primary color and the auxiliary color are located using a grayscale ruler, and the hue, saturation and lightness of the primary color and the auxiliary color are adjusted according to the preset adjustment information and positioning value, so that the depth of each auxiliary color changes evenly, generating a rich and colorful color palette of the same color system, ensuring the distinction of each color, reducing the user's visual deviation, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0054] Figure 1 It is a flowchart of a method for generating a color palette provided by an embodiment of the present application;

[0055] Figure 2 is a schematic diagram of a grayscale ruler involved in another embodiment of the present application;

[0056] Figure 3 is a schematic diagram of brightness change involved in yet another embodiment of the present application;

[0057] Figure 4is a schematic diagram of a first color palette provided in yet another embodiment of the present application;

[0058] Figure 5 is a structural schematic diagram of a color palette generation device provided in yet another embodiment of the present application;

[0059] Figure 6 It is a structural diagram of an electronic device provided in yet another embodiment of the present application. DETAILED DESCRIPTION

[0060] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0061] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0062] In today's society where digital information is developing rapidly, various Internet products emerge in an endless stream, and having your own color system is very important for building a complete user experience system. A scientific and unified color system can better provide color guidelines for designers' interface design, and rich color design can improve user experience.

[0063] In the prior art, the color system is to obtain the parameters of the main color, select a common auxiliary color, and derive multiple color palettes from light to dark. The color palette generated in this way is not rich in color, and the distinction of each color in the color palette cannot be guaranteed, which leads to visual deviations in users and affects user experience.

[0064] In order to solve the problems in the prior art, the embodiments of the present application provide a method, device, equipment and computer storage medium for generating a color palette. The method for generating a color palette provided in the embodiments of the present application is first introduced below.

[0065] Figure 1 A schematic flow chart of a method for generating a color palette provided in one embodiment of the present application is shown.

[0066] like Figure 1 As shown, the method for generating a color palette provided in an embodiment of the present application includes the following steps.

[0067] S110, obtaining a first parameter of a primary color, a first preset number of first auxiliary colors, and a grayscale scale, wherein the first parameter includes a first hue, a first saturation, and a first lightness of the primary color, and the grayscale scale includes a lightness ladder, a grayscale value corresponding to each lightness in the lightness ladder, and a positioning value, and the number of positioning values ​​is a second preset number.

[0068] In some embodiments, a user color picker or a hex color value input box is used to receive user input to obtain a first parameter of a primary color. A user input is received to obtain a first preset number of a first auxiliary color. The first preset number may be determined based on a user selection input. Multiple preset numbers are displayed, and a user click input on the first preset number is received to obtain the first preset number. For example, the multiple preset numbers are 12, 16, and 24, and the first preset number is 12.

[0069] In some embodiments, if it is detected that the main color input by the user is a colorless color, no result is generated, and an alarm message is generated so that the user can change the main color at the same time.

[0070] In some embodiments, referring to the PCCS system in the prior art, the biggest feature of the PCCS (Practical Color Coordinate System) color system is that it integrates the three attribute relationships of color into two concepts of hue and tone to form a tone series. Starting from the concept of tone, the plane shows the lightness relationship and purity relationship of each hue, and from the position of each hue in the tone series, the lightness and purity component content of the hue are clearly analyzed. The basic principle of the PCCS system is to scale the three attributes of color and form an equidistant configuration. The gray scale is obtained from the PCCS system. The gray scale, that is, the grayscale scale, can include a second preset number of levels. For example, Figure 2As shown in the figure, the grayscale includes 9 levels, and the brightness from light to dark is: 9.5, 8.5, 7.5, 6.5, 5.5, 4.5, 3.5, 2.5, 1.5. The average of the three values ​​of R, G, and B of these 9 gray blocks is their grayscale value, and the corresponding values ​​are 242, 217, 191, 166, 140, 115, 89, 63, and 38 respectively. The grayscale is set in advance.

[0071] S120, starting from the position of the primary color, selecting a first preset number of first auxiliary colors on the color wheel, and obtaining second parameters of the first auxiliary colors, where the second parameters include a second hue, a second saturation, and a second brightness.

[0072] In some embodiments, a first preset number of first auxiliary colors are selected by uniformly selecting colors on the color wheel with the primary color as the reference position.

[0073] S130, adjusting the second parameter, and calculating the brightness of the primary color and the first auxiliary color respectively according to the relationship information of hue, saturation, lightness and brightness, and taking the second auxiliary color and the primary color in the first auxiliary color whose brightness difference with the primary color is the smallest as the third auxiliary color.

[0074] In some embodiments, human eyes have different stimulation perceptions to colors with different hue attributes, such as being more sensitive to green, which looks more glaring than red and blue at the same brightness value. Therefore, the first auxiliary color is corrected, that is, the obtained second auxiliary color needs to make the visual stimulation of all colors converge to achieve color harmony.

[0075] In some embodiments, brightness is used to adjust the second parameter of the first auxiliary color. The W3C (Content Accessibility Guidelines) defines color brightness as: the relative brightness of any point in the color space, normalized to 0 for the darkest black and 1 for the brightest white. For the sRGB color space, the relative brightness formula (1) of the color is as follows:

[0076] L = 0.2126 * R + 0.7152 * G + 0.0722 * B (1)

[0077] Among them, R, G, and B refer to the brightness of red, green, and blue, respectively.

[0078] In some embodiments, HSB is also called HSV, which represents a color mode: in the HSB mode, H (hues) represents hue, S (saturation) represents saturation, and B (brightness) represents brightness. The medium corresponding to the HSB mode is the human eye. The RGB color mode is a color standard in the industry. It obtains various colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other. RGB represents the colors of the three channels of red, green, and blue. This standard almost includes all colors that can be perceived by human vision and is one of the most widely used color systems. There is fixed relationship information between the two color modes. The fixed relationship information refers to the relationship information between hue, saturation and brightness and the brightness of red, green, and blue. When the hue, saturation, and brightness are known, the brightness of red, green, and blue can be determined. The so-called "how much" of RGB refers to brightness, and is represented by integers. Usually, RGB has 256 levels of brightness, which are represented by numbers from 0, 1, 2... to 255. Note that although the highest number is 255, 0 is also one of the values, so there are 256 levels in total. Through fixed relationship information, R, G and B in the primary color and R, G and B in the first auxiliary color can be determined.

[0079] In some embodiments, when R, G and B in the primary color and R, G and B in the first auxiliary color are determined, the brightness of the primary color and the first auxiliary color can be calculated. The relative brightness of the brightness values ​​of the primary color and the first auxiliary color can be calculated. The relationship information of hue, saturation, brightness and brightness includes fixed relationship information between two color modes, and relationship information between the brightness of red, the brightness of green and the brightness of blue and the relative brightness.

[0080] S140. Calculate the gray value of the third auxiliary color using the relationship information among the hue, saturation, brightness and gray value, and the third parameter of the third auxiliary color, where the third parameter includes the third hue, the third saturation and the third brightness.

[0081] In some embodiments, hue, saturation, and brightness can be converted into red brightness, green brightness, and blue brightness using fixed relationship information, and the relationship information between hue, saturation, brightness, and grayscale values, that is, the fixed relationship information and the relationship information between the red brightness, green brightness, and blue brightness and the grayscale value. The third hue, the third saturation, and the third brightness are converted into red brightness, green brightness, and blue brightness, and the grayscale value of the third auxiliary color is calculated using the relationship information between the red brightness, green brightness, and blue brightness and the grayscale value, as well as the third parameter of the third auxiliary color. The relationship information between the red brightness, green brightness, and blue brightness and the grayscale value is as described in formula (2), and formula (2) is as follows:

[0082] Gray = (R*299 + G*587 + B*114 + 500) / 1000 (2)

[0083] Among them, Gray represents the gray value.

[0084] S150, calculating a first difference between the grayscale value of the third auxiliary color and the grayscale value corresponding to each brightness in the grayscale scale, determining that the positioning value corresponding to the first target brightness is the positioning value of the third auxiliary color, and the first target brightness is the brightness corresponding to the smallest first difference.

[0085] In some embodiments, a first difference between the grayscale value of the third auxiliary color and the grayscale value corresponding to each brightness in the grayscale scale is calculated and matched with the grayscale value on the grayscale scale. The auxiliary color is classified according to the closest distance to locate the position of the current auxiliary color in the grayscale scale. The positioning value corresponding to the first target brightness is determined as the positioning value of the third auxiliary color.

[0086] S160. Adjust the third hue, the third saturation and the third brightness according to the positioning value and the preset adjustment information to obtain a plurality of first color palettes, wherein the plurality of first color palettes include a palette of the third auxiliary color and a palette of the primary color, and each first color palette includes a second preset number of colors.

[0087] In some embodiments, a color palette with rich light and dark changes is obtained by darkening and darkening calculations based on the third auxiliary color. Lightness and darkness are relative concepts. If the third auxiliary color positioning value is n, the colors with positions smaller than n are lighter, and the colors with positions greater than n are darker. The lightening and darkening calculations of the third auxiliary color are respectively achieved by adjusting its H (third hue), S (third saturation), and B (third brightness). According to the positioning value and the preset adjustment information, the third hue, the third saturation, and the third brightness are adjusted to obtain multiple first color palettes.

[0088] In this way, the auxiliary color is determined by the parameters of the primary color and the number of auxiliary colors, and the auxiliary color is corrected according to the brightness; the primary color and the auxiliary color are located using the grayscale. And the hue, saturation and lightness of the primary and auxiliary colors are adjusted according to the preset adjustment information and positioning values, so that the depth of each auxiliary color changes evenly, and a rich and colorful color palette of the same color system is generated, which ensures the distinction of each color, reduces the visual deviation of users, and improves the user experience.

[0089] Based on this, in some embodiments, before the above S120, the method may further include:

[0090] According to the first parameter, determine the position of the main color on the color wheel;

[0091] According to the first preset number, determining the angle interval for selecting the first auxiliary color on the color wheel;

[0092] The above S120 may specifically include:

[0093] Starting from the position of the primary color on the hue wheel, select the first secondary color on the hue wheel according to the angle interval.

[0094] In some embodiments, the primary color is located on the color wheel, and the first secondary color is selected on the color wheel at an angle interval of 360° / N, where N represents a first preset number.

[0095] In this way, colors can be evenly selected on the color wheel, making the final first color palette more colorful.

[0096] Based on this, in some embodiments, the above S130 may specifically include:

[0097] Determine the brightness of the primary color and the brightness of the first auxiliary color according to the relationship information of hue, saturation, lightness and brightness;

[0098] adjusting a second parameter of the first auxiliary color and calculating a second difference between the brightness of the primary color and the brightness of the first auxiliary color;

[0099] The first auxiliary color with the smallest second difference is used as the second auxiliary color, the primary color and the second auxiliary color are used as the third auxiliary color, and the third parameter of the third auxiliary color is determined;

[0100] Among them, the adjustment range of the second parameter is within a first preset range, and the third parameter includes a third hue, a third saturation and a third brightness.

[0101] In some embodiments, the adjustment range of the second parameter is within a first preset range, and the first preset range includes the adjustment range of the second hue, the adjustment range of the second saturation, and the adjustment range of the second brightness. The first auxiliary color with a second hue adjustment range of 60°-180° (according to the principle of color addition, the visual perception of colors within this range is the most stimulating), and the adjustment range of its S value and B value is set to [-20, 20] of the first saturation and the first brightness; the adjustment range of the S value and B value of the first auxiliary color at other angles is [-10, 10]. The specific adjustment range is shown in Table 1, where s represents the second parameter of the first auxiliary color selected from the hue wheel. All auxiliary colors traverse the S value and B value within this preset range and combine them (HSB and RGB mode conversion) and substitute them into the brightness formula until the result closest to the brightness L of the primary color is obtained and output as the final data to obtain the second auxiliary color.

[0102] Table 1

[0103]

[0104]

[0105] In this way, the stimulation between colors will not deviate too much, and the color properties themselves can be maintained to the greatest extent.

[0106] Based on this, in some embodiments, the above S160 may specifically include:

[0107] According to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value and the hue, the third hue of the third auxiliary color is adjusted; according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value and the saturation, the third saturation of the third auxiliary color is adjusted; according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value, the brightness range and the brightness, the third brightness of the third auxiliary color is adjusted to obtain the first color palette.

[0108] In some embodiments, the adjustment relationship information between the positioning value and the hue includes the adjustment rule of the hue, that is, the adjustment step of the hue based on the positioning value. The adjustment relationship information between the positioning value and the saturation includes the adjustment rule of the saturation, that is, the adjustment step of the saturation based on the positioning value. The adjustment relationship information between the positioning value, the brightness range and the brightness includes the adjustment rule of the brightness, that is, the adjustment step of the brightness based on the positioning value and the brightness range. According to the positioning value of the third auxiliary color, the adjustment step of the third hue, the adjustment step of the third saturation and the adjustment step of the third brightness are searched.

[0109] In some embodiments, there may be one adjustment rule corresponding to one positioning value, and there may also be the same adjustment rule corresponding to positioning values ​​within a range.

[0110] As an example, if the positioning value of the third auxiliary color is 4 and the grayscale is 9 levels, the third hue, third saturation and third brightness are adjusted according to the adjustment step of the third hue, the adjustment step of the third saturation and the adjustment step of the third brightness to determine the color palette of the third auxiliary color, that is, the primary color palette and the color palette of the second auxiliary color.

[0111] In this way, the third parameter of the third auxiliary color is adjusted by utilizing the adjustment relationship information of the positioning value and hue, the adjustment relationship information of the positioning value and saturation, and the adjustment relationship information of the positioning value, brightness range, and brightness, so that the color depth of the first color palette changes evenly, thereby reducing the visual deviation of the user and improving the user experience.

[0112] Based on this, in some embodiments, according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value and the hue, the third hue of the third auxiliary color is adjusted; according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value and the saturation, the third saturation of the third auxiliary color is adjusted; according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value, the brightness range and the brightness, the third brightness of the third auxiliary color is adjusted to obtain the first color palette, including:

[0113] Obtaining adjustment relationship information between positioning value and hue, adjustment relationship information between positioning value and saturation, and adjustment relationship information between positioning value, brightness range, and brightness;

[0114] In the adjustment relationship information of the positioning value and the hue, a first value range of the positioning value of the third auxiliary color and a value range of the third hue are determined, and third adjustment information corresponding to the first value range and the value range of the third hue is determined;

[0115] In the adjustment relationship information of the positioning value and the saturation, a second value range of the positioning value and a third value range of the saturation of the third auxiliary color are determined, and second adjustment information corresponding to the second value range and the third value range of the saturation is determined;

[0116] In the positioning value, brightness range and brightness adjustment relationship information, determine a third value range of the positioning value and a third brightness value range of the third auxiliary color, and determine third adjustment information corresponding to the third value range and the third brightness value range;

[0117] The third hue is adjusted according to the third adjustment information, the third saturation is adjusted according to the second adjustment information, and the third brightness is adjusted according to the third adjustment information to obtain the first color palette.

[0118] In some embodiments, the adjustment relationship information of the positioning value and hue, the adjustment relationship information of the positioning value and saturation, and the adjustment relationship information of the positioning value, brightness range, and brightness are obtained. Different designs are made for the lightening and deepening changes of cold and warm tones. For example, when the cold tones are lightened, the hue gradually decreases and tends to be warm, and the resulting colors will be more vivid and natural. Since different colors are positioned differently in the color palette and have greater flexibility, the positioning needs to be fully considered in the calculation of the S value and the B value to set the adjustment step.

[0119] In some embodiments, the adjustment relationship information of the positioning value and the hue is shown in Table 2, where h represents the third hue of the third auxiliary color. Lightening specifies that the position value becomes smaller, and darkening specifies that the position value becomes larger. The adjustment step length of the positioning value is 1.

[0120] Table 2

[0121]

[0122]

[0123] In some embodiments, the saturation of the color palette of the third auxiliary color changes from light to dark, and its saturation value changes from small to large (0 is the lightest and 100 is the darkest). According to the positioning value, the saturation adjustment rules are designed in the two directions of lightening and darkening. During the lightening process, the adjustment step of the third saturation is △s. Starting from the positioning value n of the third auxiliary color, the new S value is calculated in the lightening direction. The adjustment step of the saturation of the n-1th position is: △s=n / (n-1)*(s / n); the adjustment step of the saturation from the n-2th position to the 1st position is: △s=s / n. If the initial positioning of the third auxiliary color is n=2 or n=3, the adjustment step in the lightening direction is unified as: △s=s / n. Set the lightening to minimum saturation boundary value to 1. For the darkening operation, the adjustment step formula is simpler than that for the lightening operation. In particular, if the third auxiliary color is positioned in the grayscale as n=1 or n=2, then the same formula △s=(100-s)*(n-2) / (n-1) / n is substituted according to n=3. The specific positioning value and saturation adjustment relationship information is shown in Table 3, where s represents the third saturation of the third auxiliary color. Lightening specifies that the position value becomes smaller, and darkening specifies that the position value becomes larger. The adjustment step of the positioning value is 1.

[0124] Table 3

[0125]

[0126] The adjustment step size of the n-1th bit is set in this way to ensure that the adjustment of the saturation is gentle.

[0127] As an example, for a grayscale scale with 9 levels, the saturation of the color with a positioning value of n=5 in the third auxiliary color and a third saturation of 65 is: 10, 23, 36, 49 from low to high in the light color direction (n=1 to n=4), and 70, 75, 80, 85 from low to high in the dark color direction (n=6 to n=9).

[0128] In some embodiments, the brightness changes from light to dark, and the value changes from large to small (100 is the lightest and 0 is the darkest). Since brightness plays the most critical role in color recognition, the adjustment of brightness will be more complicated. In addition to being related to the positioning value, the range of the b value obtained by each calculation will be judged in real time, and different calculations will be performed on colors in different brightness ranges. For obtaining a new b value, the newly obtained b value is substituted into the formula as the initial value for the next iterative calculation. Therefore, the b value is not a fixed initial value, but needs to be constantly matched to the brightness range according to the newly obtained b value and adjusted flexibly. The specific rules are explained as follows:

[0129] In the dodge calculation, regardless of the positioning value of the third auxiliary color, the third brightness is used as the initial b value. The third brightness is within the range of 0 to 90. Starting from the positioning value n of the third auxiliary color, the colors in the light color direction are superimposed in sequence with the same step length. The default boundary value of the result calculated with this step length is 95. During the dodge process, it is necessary to determine in real time whether the brightness corresponding to the dodge color reaches 90. Once it reaches 90, the b value corresponding to the dodge color is substituted into the formula instead of the initial b value according to the new rule, and the step length is adjusted to calculate the next light color.

[0130] In some embodiments, for the lightening operation of the auxiliary color whose brightness is in the range of 90 to 100, regardless of the positioning value, it is superimposed according to a fixed value of 5 until 100, and remains unchanged.

[0131] In some embodiments, for deepening calculation, regardless of the positioning value, if the brightness is in the range of 0 to 10, the brightness value is uniformly reduced to 0; if the brightness is in the range of 10 to 50, the step length obtained by the formula △b=(b-10)*0.2 is subtracted one by one; if the brightness is in the range of 50 to 90, the step length obtained by the formula △b=(b-25)*0.2 is subtracted one by one until the calculated current b reaches the boundary value 45, and it is determined that the current b value range has changed and belongs to the range of 10 to 50, then the current b value is substituted into △b=(b-10)*0.2 for the next calculation. The deepening operation is performed until the 8th bit, and the step length needs to be adjusted to 4 / 5 of the current step length as the last step length.

[0132] As an example, if the third auxiliary color positioning value is the 7th bit, the initial b value is 39, and the dodge step is 10 according to the formula. The b values ​​of the dodged colors are 49 at the 6th bit, 59 at the 5th bit, 69 at the 4th bit, 79 at the 3rd bit, and 89 at the 2nd bit, respectively. If the 1st bit exceeds the boundary value of 95 according to this step, the b value of the 1st bit is the boundary value 95, not 99.

[0133] In another example, if the third auxiliary color is positioned at 4, the initial b value is 80, and the fading step is 7, the fading is performed with 7 as the fixed step until the second b value is 94, and at this time it is determined that 94 belongs to the range of 90 to 100. Then the b value of the first color of the fading color is superimposed with the fixed step value 5, and the result is 94+5=99, instead of the peak value 100.

[0134] In another example, the step size is 10, the brightness value of the current color is 50, and the color to be deepened again should be 45, not 40. At this time, it is judged that the new value 45 is less than 50, and the step size is obtained again according to the formula of brightness range of 10 to 50, and the color is deepened in a decreasing manner.

[0135] In another example, the lightness of the 8th position is 73, and the previous darkening step size is 5. Then the step size to the 8th position is changed to 5 - 5 * 1 / 5 = 4, and the lightness of the 8th position is 69. If the color lightness does not meet the range of 10 - 50 until the 8th position, then calculate the lightness of the 9th position according to the step size formula in the range of 10 - 50.

[0136] In some embodiments, for the darkening operation with a lightness of 100 and in the range of 90 - 100, it needs to be calculated separately according to the positioning value. For those in the 1st to 5th positions, subtract one by one according to the step size obtained from the formula until the preset boundary value of 85. Determine that 85 belongs to the range of 50 - 90, and then use the lightness of 85 as the initial value of this range to calculate the step size according to the formula in the range of 50 - 90 until the step size can be calculated according to the formula in the range of 10 - 50. For those in the 6th to 9th positions, calculate the step size according to the same formula to obtain the difference and calculate the color lightness one by one.

[0137] In some embodiments, the specific positioning value, lightness range, and information on the adjustment relationship of lightness are shown in Table 4.

[0138] Table 4

[0139]

[0140]

[0141] Among them, the B value of the third auxiliary color is b, the positioning in the gray scale is n, and the newly obtained positioning through iterative calculation is n'. Set different boundary values for the adjustment results in different ranges. For example, for the initial lightness 0 ≤ b < 90, a boundary value of 95 is preset in the lightening calculation. The newly obtained lightness value through iterative calculation according to the formula is b'. If this value is greater than or equal to the boundary value of 95, then take the value of b' as 95. If the lightness meets 90 ≤ b < 100, then use the formula designed for this range to recalculate the step size (fixed step size 5). Similarly, a boundary value of 45 is preset in the darkening step. Once b' in the lightening step reaches 45, then b' is equal to this boundary value, and re - judge that the lightness range where b' is located meets 10 < b ≤ 50, and recalculate the lightness adjustment step size according to the range where it is located. When determining the lightness adjustment step size, it does not use a fixed known third lightness as the initial value. For the first time to determine the adjustment step size, use the third lightness as the initial value and substitute it into the formula to obtain the lightness of the n - 1 or n + 1 position adjacent to the positioning value n. For the second time to determine the adjustment step size, use the lightness of the n - 1 or n + 1 position as the initial value and substitute it into the corresponding formula to obtain the lightness with the positioning value of n - 2 or n + 2, and so on, to obtain the lightness of all colors. This process will not be elaborated here.

[0142] As an example, as Figure 3 shown, in the first color palette, the lightness corresponding to each color decreases as the positioning value increases.

[0143] In some embodiments, the first adjustment information of the third hue is determined, the second adjustment information of the third saturation is determined, and the third adjustment information of the third brightness is determined through the adjustment relationship information of the positioning value and hue, the adjustment relationship information of the positioning value and saturation, and the adjustment relationship information of the positioning value, brightness range, and brightness. And according to the third adjustment information, the third hue is adjusted, according to the second adjustment information, the third saturation is adjusted, and according to the third adjustment information, the third brightness is adjusted. Regardless of the positioning value, each third auxiliary color can generate its own color palette with rich layered changes and harmonious and natural transitions. Taking one of the color palettes as an example, the generated first color palette is as follows: Figure 4 shown.

[0144] In this way, the color depth of the first color palette obtained by step-by-step adjustment according to the defined adjustment information changes evenly, thereby reducing the visual deviation of the user and improving the user experience.

[0145] Based on this, in some embodiments, the method may further include:

[0146] Obtaining a colorless palette, the colorless palette including a second preset number of preset colors;

[0147] The transparency of the primary color palette is reduced to a preset threshold to obtain a target color palette;

[0148] The colorless color palette and the target color palette are superimposed to obtain a second color palette.

[0149] In some embodiments, a custom color of the primary color may be generated based on user needs.

[0150] This enriches the color palette.

[0151] Based on this, in some embodiments, after the above S160, the method may further include:

[0152] receiving a user's input for adjusting a target parameter of a first target color in a first color palette;

[0153] In response to the adjustment input, a parameter of the first target color is adjusted, the parameter of the first target color including hue, saturation or lightness.

[0154] In some embodiments, the user can adjust the three parameters H, S, and B within a certain range, and the color palette can change in real time based on the results.

[0155] In some embodiments, H, S and B of the third auxiliary color are (h, s, b). Among them, the adjustment range of H is (h-(360 / N-5), h+(360 / N-5))h∈(0, 360). If the h value is less than 360 / N-5 in the above adjustment range from the minimum value 1, then the range is (1, h+(360 / N-5)). The difference from the peak value 360 ​​is less than 360 / N-5, and the limit range is set as (h-(360 / N-5), 360). The adjustment range of S is (s-20, s+20)s∈(1, 100). If s is less than 20 from the minimum value 1, the adjustment range is (1, s+20), and less than 20 from the peak value 100, the adjustment range is (s-20, 100). The adjustment range of B is (b-20, b+20)b∈(1, 100). If the distance from the minimum value of b is less than 20, the adjustment range is (1, b+20), and if the distance from the peak value is less than 20, the adjustment range is (b-20, 100). It should be noted that the adjustment range of H, S, and B of the primary color in this process is the full amount, that is, h(0, 360), s(1, 100), and b(1, 100). The adjustment of the primary color does not affect the result of the auxiliary color.

[0156] In some embodiments, the user can also add, delete, and modify the names of colors.

[0157] In this way, while ensuring that visual stimulation is reduced, the user's ultimate needs must still be taken into consideration.

[0158] Based on this, in some embodiments, the method may further include:

[0159] receiving a fourth parameter input by a user, where the fourth parameter includes a fourth hue, a fourth saturation, and a fourth brightness;

[0160] Calculate the similarity value between the parameter of the second target color in multiple first color palettes and the fourth parameter. When the similarity value between the target parameter and the fourth parameter is greater than a preset threshold, output the color corresponding to the target parameter. When the similarity value between the target parameter and the fourth parameter is not greater than the preset threshold, output the color corresponding to the fourth parameter.

[0161] In some embodiments, similar colors can be searched in the color palette based on the user's input. If the similarity value between the target parameter and the fourth parameter is not greater than a preset threshold, it means that there is no color similar to the user's requirement in the generated color palette, and the color required by the user is directly output.

[0162] In this way, while ensuring that visual stimulation is reduced, the user's ultimate needs must still be taken into consideration.

[0163] In the embodiment provided in the present application, for the visual design of the interface, the commonly used colors are quickly output according to the first color palette provided in the present application. Five categories are generated: product primary color, functional color, wireframe color, interface background, and text color. The main color of the interface can be selected in the first color palette. The main color of the interface is set to two colors, normal state and failure state, by default. The failure state is obtained by reducing the transparency of the main color of the interface itself; the functional color is divided into four colors: prohibition, warning, instruction, and success, which can also be selected in the first color palette, that is, the general information instruction category is set to: red, yellow, blue, and green. The wireframe, background, and text are all obtained by adjusting the transparency from black and white, and the background color (custom color of the main color) is divided into light gray and dark gray, which are all obtained from the set second color palette. Provide users with the function of adding categories, and edit, delete, add, and other operations on colors of different categories separately. Common color categories are shown in Table 5.

[0164]

[0165] In the embodiment provided in the present application, a dynamic positioning value is obtained by matching the grayscale value of the color with the grayscale value in the grayscale scale, and the calculation rules of the three parameters H, S, and B are designed to generate a set of continuous color plates with rich levels. The basic colorimetric theory of the HSB color model is used, combined with the color brightness formula, to achieve automatic color correction to obtain a set of auxiliary colors that are as close as possible to the sensory stimulation intensity of the primary color.

[0166] Based on the color palette generation method provided in the above embodiment, the present application also provides a specific implementation of a color palette generation device. Please refer to the following embodiment.

[0167] See also Figure 5 , the color palette generation device 500 provided in the embodiment of the present application includes:

[0168] An acquisition module 510 is used to acquire a first parameter of a primary color, a first preset number of first auxiliary colors, and a grayscale scale, wherein the first parameter includes a first hue, a first saturation, and a first lightness of the primary color, and the grayscale scale includes a lightness ladder, a grayscale value corresponding to each lightness in the lightness ladder, and a positioning value, wherein the number of positioning values ​​is a second preset number;

[0169] A selection module 520 is used to select a first preset number of first auxiliary colors on the color wheel starting from the position of the primary color, and obtain second parameters of the first auxiliary colors, where the second parameters include a second hue, a second saturation, and a second lightness;

[0170] An adjustment module 530 is used to adjust the second parameter, and calculate the brightness of the primary color and the first auxiliary color respectively according to the relationship information of the hue, saturation, lightness and brightness, and use the second auxiliary color and the primary color in the first auxiliary color with the smallest brightness difference with the primary color as the third auxiliary color;

[0171] A calculation module 540 is used to calculate the gray value of the third auxiliary color by using the relationship information of the hue, saturation, brightness and gray value, and the third parameter of the third auxiliary color, where the third parameter includes a third hue, a third saturation and a third brightness;

[0172] A determination module 550 is used to calculate a first difference between the gray value of the third auxiliary color and the gray value corresponding to each brightness in the grayscale scale, determine that the positioning value corresponding to the first target brightness is the positioning value of the third auxiliary color, and the first target brightness is the brightness corresponding to the minimum first difference;

[0173] The adjustment module 530 is also used to adjust the third hue, the third saturation and the third brightness according to the positioning value and the preset adjustment information to obtain multiple first color palettes, the multiple first color palettes including a color palette of the third auxiliary color and a color palette of the primary color, and each first color palette includes a second preset number of colors.

[0174] Based on this, in some embodiments, the apparatus 500 may further include:

[0175] The determination module 550 is further used to determine the position of the primary color on the hue circle according to the first parameter before selecting a first preset number of first auxiliary colors on the hue circle starting from the position of the primary color;

[0176] The selection module 520 is further used to determine the angle interval for selecting the first auxiliary color on the color wheel according to the first preset number;

[0177] The selection module 520 is used to:

[0178] Starting from the position of the primary color on the hue wheel, select the first secondary color on the hue wheel according to the angle interval.

[0179] Based on this, in some embodiments, the adjustment module 530 may include:

[0180] a determination unit, configured to determine the brightness of the primary color and the brightness of the first auxiliary color according to the relationship information among the hue, saturation, brightness and brightness;

[0181] an adjusting unit, configured to adjust a second parameter of the first auxiliary color and calculate a second difference between the brightness of the primary color and the brightness of the first auxiliary color;

[0182] A determination unit, configured to use the first auxiliary color with the smallest second difference as the second auxiliary color, use the primary color and the second auxiliary color as the third auxiliary color, and determine a third parameter of the third auxiliary color;

[0183] Among them, the adjustment range of the second parameter is within a first preset range, and the third parameter includes a third hue, a third saturation and a third brightness.

[0184] Based on this, in some embodiments, the adjustment module 530 may include:

[0185] The adjustment submodule is used to adjust the third hue of the third auxiliary color according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value and the hue, adjust the third saturation of the third auxiliary color according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value and the saturation, and adjust the third brightness of the third auxiliary color according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value, brightness range and brightness, so as to obtain the first color palette.

[0186] Based on this, in some embodiments, the adjustment submodule may include:

[0187] An acquisition unit, used to acquire adjustment relationship information between the positioning value and hue, adjustment relationship information between the positioning value and saturation, and adjustment relationship information between the positioning value, brightness range, and brightness;

[0188] The determination unit is further used to determine a first value range of the positioning value and a value range of the third hue of the third auxiliary color in the adjustment relationship information of the positioning value and the hue, and determine third adjustment information corresponding to the first value range and the value range of the third hue;

[0189] The determining unit is further used to determine a second value range of the positioning value and a third value range of the saturation of the third auxiliary color in the adjustment relationship information of the positioning value and the saturation, and determine second adjustment information corresponding to the second value range and the third value range of the saturation;

[0190] The determining unit is further used to determine a third value range of the positioning value and a third value range of the third auxiliary color in the positioning value, the brightness range and the adjustment relationship information of the brightness, and determine third adjustment information corresponding to the third value range and the third value range of the third brightness;

[0191] The adjustment unit is further used to adjust the third hue according to the third adjustment information, adjust the third saturation according to the second adjustment information, and adjust the third brightness according to the third adjustment information to obtain the first color palette.

[0192] Based on this, in some embodiments, the apparatus 500 may further include:

[0193] The acquisition module 510 is further used to acquire a colorless color palette, where the colorless color palette includes a second preset number of preset colors;

[0194] A reduction module, used to reduce the transparency of the primary color palette to a preset threshold value to obtain a target color palette;

[0195] The superposition module is used to superimpose the achromatic color palette and the target color palette to obtain a second color palette.

[0196] Based on this, in some embodiments, the apparatus 500 may further include:

[0197] A receiving module, configured to receive a user's input for adjusting a target parameter of a first target color in a first color palette after adjusting the third hue, the third saturation and the third brightness according to the positioning value and the preset adjustment information to obtain a plurality of first color palettes;

[0198] The adjustment module 530 is further configured to adjust the parameters of the first target color in response to the adjustment input, where the parameters of the first target color include hue, saturation or brightness.

[0199] Based on this, in some embodiments, the apparatus 500 may further include:

[0200] The receiving module is further used to receive a fourth parameter input by a user, where the fourth parameter includes a fourth hue, a fourth saturation and a fourth brightness;

[0201] The output module is used to calculate the similarity value between the parameter of the second target color in multiple first color palettes and the fourth parameter, and output the color corresponding to the target parameter when the similarity value between the target parameter and the fourth parameter is greater than a preset threshold value; when the similarity value between the target parameter and the fourth parameter is not greater than the preset threshold value, output the color corresponding to the fourth parameter.

[0202] The various modules of the color palette generation device provided in the embodiment of the present application can realize the functions of the various steps of the color palette generation method provided above and achieve the corresponding technical effects, which will not be described in detail here for the sake of brevity.

[0203] Based on the same inventive concept, an embodiment of the present application also provides an electronic device.

[0204] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.

[0205] The electronic device may include a processor 601 and a memory 602 storing computer program instructions.

[0206] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0207] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 602 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 602 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 602 is a non-volatile solid-state memory.

[0208] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of the present disclosure.

[0209] The processor 601 reads and executes the computer program instructions stored in the memory 602 to implement any one of the color palette generation methods in the above embodiments.

[0210] In one example, the electronic device may further include a communication interface 603 and a bus 610. Figure 6 As shown, the processor 601, the memory 602, and the communication interface 603 are connected via a bus 610 and communicate with each other.

[0211] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0212] The bus 610 includes hardware, software or both, coupling the components of the electronic device to each other. For example, but not limitation, the bus may include an accelerated graphics port (Accelerated Graphics Port, AGP) or other graphics bus, an enhanced industry standard architecture (Extended Industry Standard Architecture, EISA) bus, a front side bus (Front Side Bus, FSB), a hypertransport (Hyper Transport, HT) interconnection, an industry standard architecture (Industry Standard Architecture, ISA) bus, an infinite bandwidth interconnection, a low pin count (Linear Predictive Coding, LPC) bus, a memory bus, a micro channel architecture (MicroChannel Architecture, MCA) bus, a peripheral component interconnect (Peripheral Component Interconnect, PCI) bus, a PCI-Express (Peripheral Component Interconnect-X, PCI-X) bus, a serial advanced technology attachment (Serial Advanced Technology Attachment, SATA) bus, a video electronics standard association local (VESA Local Bus, VLB) bus or other suitable buses or a combination of two or more of these. Where appropriate, the bus 610 may include one or more buses. Although the embodiments of the present application describe and illustrate a specific bus, the present application considers any suitable bus or interconnection. The electronic device can execute the color palette generation method in the embodiments of the present invention, thereby realizing the above-mentioned color palette generation method.

[0213] In addition, in combination with the color palette generation method in the above embodiment, the present application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any color palette generation method in the above embodiment is implemented.

[0214] The present application also provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes each process of implementing any one of the above-mentioned color palette generation method embodiments.

[0215] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0216] The functional blocks shown in the structural block diagram described above can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or communication link by a data signal carried in a carrier. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (Read-Only Memory, ROM), flash memory, erasable read-only memory (Erasable ReadOnly Memory, EROM), floppy disks, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical discs, hard disks, optical fiber media, radio frequency (Radio Frequency, RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0217] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0218] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0219] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A method for generating a color palette, characterized in that: include: Obtaining a first parameter of a primary color, a first preset number of first auxiliary colors, and a grayscale, wherein the first parameter includes a first hue, a first saturation, and a first lightness of the primary color, and the grayscale includes a lightness ladder, a grayscale value corresponding to each lightness in the lightness ladder, and a positioning value, wherein the number of the positioning values ​​is a second preset number; Starting from the position of the primary color, selecting the first preset number of the first auxiliary colors on the color wheel, and obtaining second parameters of the first auxiliary colors, wherein the second parameters include a second hue, a second saturation, and a second lightness; adjusting the second parameter, and calculating the brightness of the primary color and the first auxiliary color respectively according to the relationship information of hue, saturation, lightness and brightness, and taking the second auxiliary color with the smallest brightness difference with the primary color in the first auxiliary color and the primary color as the third auxiliary color; Calculating the gray value of the third auxiliary color by using the relationship information among the hue, saturation, brightness and gray value, and the third parameter of the third auxiliary color, wherein the third parameter includes the third hue, the third saturation and the third brightness; Calculate a first difference between the grayscale value of the third auxiliary color and the grayscale value corresponding to each brightness in the grayscale scale, determine that the positioning value corresponding to the first target brightness is the positioning value of the third auxiliary color, and the first target brightness is the brightness corresponding to the smallest first difference; According to the positioning value and the preset adjustment information, the third hue, the third saturation and the third brightness are adjusted to obtain multiple first color palettes, wherein the multiple first color palettes include a color palette of the third auxiliary color and a color palette of the primary color, and each first color palette includes the second preset number of colors.

2. The method for generating a color palette according to claim 1, characterized in that: Before selecting the first preset number of the first auxiliary colors on the color wheel starting from the position of the primary color, the method further includes: Determining the position of the primary color on the hue circle according to the first parameter; Determining, according to the first preset number, an angle interval for selecting the first auxiliary color on the color wheel; The step of selecting the first preset number of the first auxiliary colors on the color wheel starting from the position of the primary color includes: Starting from the position of the primary color on the hue circle, the first secondary color is selected on the hue circle according to the angle interval.

3. The method for generating a color palette according to claim 2, characterized in that: The adjusting the second parameter, and calculating the brightness of the primary color and the first auxiliary color respectively according to the relationship information of hue, saturation, lightness and brightness, and taking the second auxiliary color in the first auxiliary color with the smallest brightness difference with the primary color and the primary color as the third auxiliary color, comprises: Determining the brightness of the primary color and the brightness of the first auxiliary color according to the relationship information of the hue, saturation, lightness and brightness; adjusting a second parameter of the first auxiliary color, and calculating a second difference between the brightness of the primary color and the brightness of the first auxiliary color; Taking the first auxiliary color with the smallest second difference as the second auxiliary color, taking the primary color and the second auxiliary color as the third auxiliary color, and determining a third parameter of the third auxiliary color; The adjustment range of the second parameter is within a first preset range, and the third parameter includes a third hue, a third saturation and a third brightness.

4. The method for generating a color palette according to any one of claims 1 to 3, characterized in that: The step of adjusting the third hue, the third saturation, and the third brightness according to the positioning value and the preset adjustment information to obtain a first color palette includes: According to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value and the hue, the third hue of the third auxiliary color is adjusted; according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value and the saturation, the third saturation of the third auxiliary color is adjusted; according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value, the brightness range and the brightness, the third brightness of the third auxiliary color is adjusted to obtain the first color palette.

5. The method for generating a color palette according to claim 4, characterized in that: The method of adjusting the third hue of the third auxiliary color according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value and the hue, adjusting the third saturation of the third auxiliary color according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value and the saturation, and adjusting the third brightness of the third auxiliary color according to the positioning value of the third auxiliary color and the adjustment relationship information between the positioning value, the brightness range and the brightness, to obtain a first color palette includes: Obtaining adjustment relationship information between positioning value and hue, adjustment relationship information between positioning value and saturation, and adjustment relationship information between positioning value, brightness range, and brightness; In the adjustment relationship information of the positioning value and the hue, a first value range of the positioning value of the third auxiliary color and a value range of the third hue are determined, and third adjustment information corresponding to the first value range and the value range of the third hue is determined; In the adjustment relationship information of the positioning value and the saturation, determine a second value range of the positioning value of the third auxiliary color and a value range of the third saturation, and determine second adjustment information corresponding to the second value range and the value range of the third saturation; Determine, in the positioning value, brightness range and brightness adjustment relationship information, a third value range of the positioning value of the third auxiliary color and a value range of the third brightness, and determine third adjustment information corresponding to the third value range and the value range of the third brightness; The third hue is adjusted according to the third adjustment information, the third saturation is adjusted according to the second adjustment information, and the third brightness is adjusted according to the third adjustment information to obtain a first color palette.

6. The method for generating a color palette according to claim 1, characterized in that: Also includes: Acquire a colorless palette, wherein the colorless palette includes a second preset number of preset colors; The transparency of the primary color palette is reduced to a preset threshold to obtain a target color palette; The achromatic color palette and the target color palette are superimposed to obtain a second color palette.

7. The method for generating a color palette according to claim 1, characterized in that: After adjusting the third hue, the third saturation and the third brightness according to the positioning value and the preset adjustment information to obtain a plurality of first color palettes, the method further includes: receiving a user's input for adjusting a target parameter of a first target color in the first color palette; In response to the adjustment input, a parameter of the first target color is adjusted, the parameter of the first target color including hue, saturation or brightness.

8. The method for generating a color palette according to claim 1, characterized in that: Also includes: receiving a fourth parameter input by a user, wherein the fourth parameter includes a fourth hue, a fourth saturation, and a fourth brightness; Calculate the similarity value between the parameter of the second target color in the multiple first color palettes and the fourth parameter, and when the similarity value between the target parameter and the fourth parameter is greater than a preset threshold, output the color corresponding to the target parameter; when the similarity value between the target parameter and the fourth parameter is not greater than the preset threshold, output the color corresponding to the fourth parameter.

9. A color plate generating device, characterized in that: include: an acquisition module, configured to acquire a first parameter of a primary color, a first preset number of first auxiliary colors, and a grayscale scale, wherein the first parameter includes a first hue, a first saturation, and a first lightness of the primary color, and the grayscale scale includes a lightness ladder, a grayscale value corresponding to each lightness in the lightness ladder, and a positioning value, wherein the number of the positioning values ​​is a second preset number; a selection module, configured to select the first preset number of the first auxiliary colors on the color wheel starting from the position of the primary color, and obtain second parameters of the first auxiliary colors, wherein the second parameters include a second hue, a second saturation, and a second lightness; an adjustment module, configured to adjust the second parameter, and calculate the brightness of the primary color and the first auxiliary color respectively according to the relationship information of hue, saturation, lightness and brightness, and use the second auxiliary color in the first auxiliary color with the smallest brightness difference with the primary color and the primary color as the third auxiliary color; a calculation module, configured to calculate the gray value of the third auxiliary color by using the relationship information among the hue, saturation, brightness and gray value, and the third parameter of the third auxiliary color, wherein the third parameter includes a third hue, a third saturation and a third brightness; A determination module, configured to calculate a first difference between the grayscale value of the third auxiliary color and the grayscale value corresponding to each brightness in the grayscale scale, and determine that the positioning value corresponding to the first target brightness is the positioning value of the third auxiliary color, wherein the first target brightness is the brightness corresponding to the smallest first difference; The adjustment module is also used to adjust the third hue, the third saturation and the third brightness according to the positioning value and preset adjustment information to obtain multiple first color palettes, wherein the multiple first color palettes include a color palette of the third auxiliary color and a color palette of the primary color, and each first color palette includes the second preset number of colors.

10. An electronic device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the method for generating a color palette as described in any one of claims 1 to 8 is implemented.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method for generating a color palette according to any one of claims 1 to 8 is implemented.