Interface color setting method, device, equipment and storage medium
By generating color swatches and automatically setting interface object colors, it solves the problem of color design and development collaboration in interface design and development, improves efficiency and aesthetics, and achieves unified color standards.
Patent Information
- Application Number
- CN202011008181.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-23
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-09-23
AI Technical Summary
In the interface design and development process, the lack of unified color standards makes it difficult for developers to collaborate, and the simple reliance on adding black and white results in a lack of beauty and incoordination in color matching.
By receiving the user's color setting instructions, it generates a color palette, including the target color and its adjacent colors, and automatically sets the color of the interface object according to the preset mapping relationship between the interface object and the color palette to achieve unified color design.
It improves the efficiency of interface design and development, saves human resources, ensures the coordination and beauty of color matching, and solves the problem of unity in color design and development collaboration.
Smart Images

Figure CN112148288B
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to an interface color setting method, device, equipment and storage medium. Background Art
[0002] When designing interfaces, dialog boxes, message boxes, etc. for electronic device applications or systems, color design is usually involved. Color design has always been a perceptual selection process, and there is usually no algorithm to standardize the use of colors. Different objects in the same interface may usually use different colors, generally using a primary color and several adjacent colors.
[0003] In the prior art, each change of color usually requires the designer to provide the corresponding color parameters. When building a simple page, it is difficult for the front-end development engineer to control the color selection without the help of the designer. If the designer does not provide color parameters, the development engineer will mostly directly change the black or white in the color value to achieve the color depth change when building the page, or directly cover the color with a white or black layer and adjust the transparency to achieve the color change.
[0004] Since developers other than designers lack sensitivity in color selection and matching, it is difficult to match suitable colors without the help of designers. The method of simply adding black and white makes the colors lack aesthetic appeal. In addition, different designers will give different color values, which makes it difficult to unify standards in design and development work, which is not conducive to collaboration in the design and development process. Summary of the invention
[0005] The embodiments of the present invention provide an interface color setting method, device, equipment and storage medium, which are used to realize that only one color needs to be selected during the interface design and development process to determine other adjacent colors, realize automatic design of interface colors, unify color standards, and improve interface design and development efficiency.
[0006] In a first aspect, an embodiment of the present invention provides an interface color setting method, comprising:
[0007] receiving a color setting instruction from a user, wherein the color setting instruction includes color parameters of a target color set by the user;
[0008] Generate a color palette according to the color parameters of the target color and a preset color palette generation rule, wherein the color palette includes the target color and a plurality of adjacent colors of the target color, wherein the adjacent colors are lighter and / or darker than the target color;
[0009] The color of each object in the interface is set according to the color palette and a preset mapping relationship between each object in the interface and each color position in the color palette.
[0010] In a second aspect, an embodiment of the present invention provides an interface color setting device, comprising:
[0011] A receiving module, used for receiving a color setting instruction from a user, wherein the color setting instruction includes color parameters of a target color set by the user;
[0012] A color palette acquisition module, used to generate a color palette according to the color parameters of the target color and a preset color palette generation rule, wherein the color palette includes the target color and a plurality of adjacent colors of the target color, wherein the adjacent colors are lighter and / or darker than the target color;
[0013] The setting module is used to set the color of each object in the interface according to the color palette and the preset mapping relationship between each object in the interface and each color position in the color palette.
[0014] In a third aspect, an embodiment of the present invention provides an electronic device, including: at least one processor; and a memory;
[0015] The memory stores computer-executable instructions;
[0016] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to the first aspect.
[0017] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in the first aspect is implemented.
[0018] The interface color setting method, device, equipment and storage medium provided by the embodiment of the present invention receive a color setting instruction from a user, wherein the color setting instruction includes the color parameters of a target color set by the user; a color palette is generated according to the color parameters of the target color and a preset color palette generation rule, wherein the color palette includes the target color and a plurality of adjacent colors of the target color, wherein the adjacent colors are lighter and / or darker colors than the target color; and the color of each object in the interface is set according to the color palette and the preset mapping relationship between each object in the interface and each color position in the color palette. In the embodiment of the present invention, during the interface design and development process, the user only needs to determine the target color to obtain a plurality of other adjacent colors and generate a color palette, and then the automatic design of the interface color can be realized according to the color palette and the preset mapping relationship between each object in the interface and each color position in the color palette, which can unify the color standard of the interface design, improve the efficiency of interface design and development, save human resources, and avoid the single color change caused by simply modifying the black and white values in the color, which makes the interface color matching uncoordinated and lacks aesthetics, affecting the interface display effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0020] Figure 1 A schematic diagram of an interface provided by an embodiment of the present invention;
[0021] Figure 2 A flowchart of a method for setting interface color provided by an embodiment of the present invention;
[0022] Figure 3 A flowchart of a method for setting interface color provided by another embodiment of the present invention;
[0023] Figure 4 A schematic diagram of the color wheel provided by the present invention and the luminosity after the color wheel is decolored;
[0024] Figure 5 A schematic diagram of a luminosity-hue relationship diagram provided by an embodiment of the present invention;
[0025] Figure 6a Schematic diagram of the cross-color gamut phenomenon of the color palette in an embodiment of the present invention;
[0026] Figure 6b This is a schematic diagram of a color palette without cross-color gamut phenomenon in an embodiment of the present invention;
[0027] Figure 7 A schematic diagram of generating a color palette based on a target color provided in an embodiment of the present invention;
[0028] Figure 8 A structural diagram of an interface color setting device provided by an embodiment of the present invention;
[0029] Fig. 9 A structural diagram of an electronic device for executing an interface color setting method provided by an embodiment of the present invention.
[0030] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0031] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0032] In the prior art, during the interface design and development process, different objects in the same interface may usually use different colors, generally using a primary color and several adjacent colors, such as Figure 1 As shown in the figure, the page header, page footer, buttons, table headers, text and other objects in the interface can use different colors from the main color and several adjacent colors. Each change of color usually requires the designer to provide corresponding color parameters. When building a simple page, it is difficult for front-end developers to control the color selection without the help of the designer. If there is no color parameter provided by the designer, when building the page, the development engineer will mostly directly change the black or white in the color value to achieve the color depth change, or directly cover the color with a white or black layer and adjust the transparency to achieve the color change.
[0033] Since developers other than designers lack sensitivity in color selection and matching, it is difficult to match suitable colors without the help of designers. The method of simply adding black and white makes the colors lack aesthetic appeal. In addition, different designers will give different color values, which makes it difficult to unify standards in design and development work, which is not conducive to collaboration in the design and development process.
[0034] In view of the above-mentioned problems of the prior art, an embodiment of the present invention discloses an interface color setting method, which obtains color palette generation rules in advance, and then the user only needs to determine the target color to obtain multiple other adjacent colors that are lighter and / or darker than the target color, generate a color palette, and provide a basis for interface color selection; in order to be able to automatically set the color of each object in the interface when setting the color of each object, and to adopt a unified interface color matching to achieve a unified interface display effect, the mapping relationship between each object in the interface and each color position in the color palette can be pre-set, and then after obtaining the color palette, the color of each object in the interface can be set according to the color palette and the preset mapping relationship between each object in the interface and each color position in the color palette, so as to realize automatic design of interface color, unify the color standard of interface design, improve interface design and development efficiency, save human resources, and avoid the single color change caused by simply modifying the black and white values in the color, which makes the interface color matching inconsistent and lacks aesthetics, affecting the interface display effect.
[0035] The specific application scenario of the embodiment of the present invention is the interface design and development scenario, and can also be the interface use scenario. Specifically, in the interface design and development scenario, the user can be the interface designer or developer. In the interface design or development process, the user can first set any target color, and the user can specifically set the color parameters of the target color, such as hue (Hue, H for short), saturation (Saturation, S for short), and brightness (B for short); and in the interface use scenario, the user can also be the user of the interface. The user can also set the interface color according to his or her own preferences during the use of the interface. The user can first set any target color, and the user can specifically set the color parameters of the target color, such as hue, saturation, and brightness. When setting the target color, the user can send a color setting instruction to the electronic device. After receiving the user's color setting instruction, the electronic device generates a color palette according to the color parameters of the target color and the preset color palette generation rules. The color palette includes the target color and multiple adjacent colors of the target color, and the adjacent colors are lighter and / or darker colors than the target color; according to the color palette and the preset mapping relationship between each object in the interface and each color position in the color palette, the color of each object in the interface is set.
[0036] The following specific embodiments are used to describe in detail the technical solutions of the present invention and how the technical solutions of the present application solve the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0037] Figure 2This is a flow chart of the interface color setting method provided by an embodiment of the present invention. This embodiment provides an interface color setting method, the execution subject of which can be any electronic device, and the specific steps of the interface color setting method are as follows:
[0038] S201 : Receive a color setting instruction from a user, where the color setting instruction includes color parameters of a target color set by the user.
[0039] In this embodiment, the user can be a designer or developer of the interface. During the interface design or development process, the user can first set any target color. The user can specifically set the color parameters of the target color, such as hue, saturation, and brightness. Alternatively, the user can also be a user of the interface. The user can also set the interface color according to his or her own preferences during the use of the interface. The user can first set any target color. The user can specifically set the color parameters of the target color, such as hue, saturation, and brightness. When setting the target color, the user can send a color setting instruction to the electronic device, wherein the color setting instruction includes the color parameters of the target color set by the user. In this embodiment, the form of the color setting instruction is not limited, and it can be various forms of instructions such as keyboard input, click selection, and voice input.
[0040] S202, generating a color palette according to color parameters of the target color and a preset color palette generation rule, wherein the color palette includes the target color and a plurality of adjacent colors of the target color, wherein the adjacent colors are lighter and / or darker than the target color.
[0041] In this embodiment, the color parameters of the target color are taken as a reference, that is, the target color is taken as the main color, and multiple adjacent colors of the target colors are obtained according to a preset color palette generation rule. These adjacent colors may include colors lighter than the target color, and may also include colors darker than the target color. The adjacent colors of the target colors and the target color together constitute a color palette. Optionally, the colors in the color palette can be sorted according to depth. The color palette can be used to select appropriate colors from the color palette when setting the colors of various objects in the interface. For example, if some objects in the interface need to use darker colors, then the darker colors are selected from the color palette; if some objects need to use lighter colors, then the lighter colors are selected from the color palette.
[0042] S203: setting the color of each object in the interface according to the color palette and a preset mapping relationship between each object in the interface and each color position in the color palette.
[0043] In this embodiment, when setting the color of each object in the interface, in order to ensure that the color of each object in the interface can be automatically set, and a relatively unified interface color combination can be used to achieve a unified interface display effect, in this embodiment, the mapping relationship between each object in the interface and each color position in the color palette can be pre-set. For example, the color palette has 10 color positions, which can include 10 colors. After the target color and the adjacent color are obtained in S201 and S202, the target color and the adjacent color can be filled in the color positions of the color palette in order of depth. If a certain object in the interface has a mapping relationship with a certain color position in the color palette, the color of the object is set according to the color filled in the color position. For example, the page header, page footer and the button in the page correspond to the 6th color position of the color palette, and the text in the page header, page footer and button corresponds to the 1st color position of the color palette, and so on. Examples are not given one by one here. After obtaining the color palette, the color of the page header, page footer and button can be set according to the color of the 6th color position of the color palette, and the color of the page header, page footer and button text can be set according to the color of the 1st color position of the color palette.
[0044] The interface color setting method provided in this embodiment receives a color setting instruction from a user, wherein the color setting instruction includes color parameters of a target color set by the user; generates a color palette according to the color parameters of the target color and a preset color palette generation rule, wherein the color palette includes the target color and a plurality of adjacent colors of the target color, wherein the adjacent colors are lighter and / or darker colors than the target color; and sets the color of each object in the interface according to the color palette and a preset mapping relationship between each object in the interface and each color position in the color palette. In this embodiment, during the interface design and development process, the user only needs to determine the target color to obtain a plurality of other adjacent colors and generate a color palette, and then the automatic design of the interface color can be realized according to the mapping relationship between the color palette and each object in the interface and each color position in the color palette, which can unify the color standard of the interface design, improve the efficiency of the interface design and development, save human resources, and avoid the single color change caused by simply modifying the black and white values in the color, which makes the interface color matching uncoordinated and lacks aesthetics, affecting the interface display effect.
[0045] Based on any of the above embodiments, Figure 3 As shown, the step S202 of generating a color palette according to the color parameters of the target color and a preset color palette generation rule specifically includes:
[0046] S301, according to the color parameters of the target color and the preset color palette generation rule, gradually performing a lightening operation and / or a darkening operation on the target color to obtain a first preset number of first adjacent colors and / or a second preset number of second adjacent colors;
[0047] S302: Sort the first adjacent color, the target color, and the second adjacent color according to the depth of the color to obtain the color palette.
[0048] In this embodiment, a color palette generation rule can be obtained in advance, and then based on the color parameters of the target color and according to the color palette generation rule, a lightening operation is gradually performed on the target color to obtain a first preset number of first adjacent colors, and / or a darkening operation is gradually performed on the target color to obtain a second preset number of second adjacent colors, and then the first adjacent colors, the target color, and the second adjacent colors are sorted according to lightness and darkness to obtain the color palette.
[0049] Optionally, the colors in the color palette may be sorted from light to dark, and optionally, the target color may be a color in the middle of the color palette from light to dark. For example, the color palette may include 10 colors from light to dark, and the target color may be the sixth color.
[0050] In the above embodiment, the law of color change can be analyzed in advance, as follows:
[0051] First, decolorize the colors in the color wheel (also called color ring, hue ring), where the color wheel is a ring formed by arranging the color sequence from hue from 0 to 360° in sequence. After decolorization, the brightness of each color in the color wheel is obtained, as shown in the schematic diagram. Figure 4 As shown (here only the grayscale image is used as an example, and the specific colors on the color wheel are the colors of the universal color wheel), the number is the brightness of the color at that position. Placing these brightness values and the corresponding hue values on the number axis can obtain a brightness-hue relationship diagram, as shown in Figure 5 As shown, we can know that hue itself actually has brightness. Put the colors of each hue value on the color wheel on the number axis, with hue on the horizontal axis and brightness on the vertical axis, and then connect them into a line. You will find that this broken line has experienced three high points (maximum values) and three low points (minimum values). The three high points are yellow, cyan, and magenta, with hues of 60°, 180°, and 300° respectively. The three low points are red, green, and blue, with hues of 0°, 120°, and 240° respectively. The hue changes from dark to light to dark to light to dark to light from left to right. Therefore, a pattern can be obtained:
[0052] If you want a darker variation, move the Hue value toward the three high points, toward the closest point;
[0053] If you want a lighter variation, move the Hue value toward the three lower points, toward the closest point;
[0054] The following color matching rules are summarized:
[0055] If you need to get a darker color, you need the hue (H) to be biased towards the three lowest points (red, green, and blue) closest to the hue of the target color, the brightness (B) to be reduced, and the saturation (S) to be increased;
[0056] If a lighter color is needed, the hue (H) needs to be biased toward the three highest points (yellow, cyan, and magenta) closest to the hue of the target color, the brightness (B) needs to be increased, and the saturation (S) needs to be decreased.
[0057] Based on the above rules, the color palette generation rules can be set, and then the color palette can be quickly generated according to the color palette generation rules.
[0058] On the basis of the above embodiment, the step of gradually performing a lightening operation and / or a darkening operation on the target color according to the color parameters of the target color and the preset color palette generation rule in S301 to obtain a first preset number of first adjacent colors and / or a second preset number of second adjacent colors respectively may specifically include:
[0059] According to the hue, saturation and brightness of the target color, the corresponding target preset saturation setting rule, target preset brightness setting rule, and target preset hue setting rule in the color palette generation rule are determined respectively, and the saturation, brightness and hue of each of the first adjacent colors and / or each of the second adjacent colors are obtained in turn according to these rules.
[0060] In this embodiment, based on the above-mentioned color adjustment rules, it can be found that when the hue of the target color is at different positions in the luminosity-hue relationship diagram, different operations may need to be adopted when performing a lightening operation or a darkening operation. Therefore, based on the above-mentioned color adjustment rules, different intervals can be set for the hue, saturation and brightness, respectively, and different setting rules can be used in different intervals to perform lightening operations and / or darkening operations to obtain the saturation, brightness and hue of each first adjacent color and / or each second adjacent color.
[0061] On the basis of the above embodiment, at least three preset saturation ranges may be preset within the saturation interval of 0 to 100%, and the at least three preset saturation ranges include a maximum preset saturation range, an intermediate preset saturation range, and a minimum preset saturation range; optionally, the maximum preset saturation range may be 100% ≥ S > 95%, the intermediate preset saturation range may be 95% ≥ S > 30%, and the minimum preset saturation range may be 30% ≥ S > 0. Of course, the above manner of dividing the range intervals is not limited in this embodiment, and more ranges may be divided, and are not limited to three ranges.
[0062] In this embodiment, when the saturation of each of the first adjacent colors and / or each of the second adjacent colors is sequentially acquired according to the target preset saturation setting rule, it can be divided into at least the following situations:
[0063] The first case: if the saturation of the target color is within the maximum preset saturation range, during a lightening operation, a first step length is obtained to reduce the saturation from the saturation of the target color to a preset minimum saturation value, and the saturation of each of the first adjacent colors is set in sequence according to the first step length; and / or, during a darkening operation, the saturation of each of the second adjacent colors is kept equal to the preset maximum saturation value.
[0064] In this embodiment, the maximum preset saturation range can be 100% ≥ S > 95%, and of course it can also be other ranges. When the saturation of the target color is within the maximum preset saturation range, in the lightening operation, the saturation of each first adjacent color can be set by decreasing the saturation with a first step length based on the saturation of the target color, wherein the first step length can be determined by the saturation of the target color, the preset minimum saturation value, and the number of first adjacent colors, that is, the step length of the saturation of the first adjacent color from the saturation of the target color to the preset minimum saturation value is equal to the ratio of the difference between the saturation of the target color and the preset minimum saturation value to the number of first adjacent colors. It should be noted that the preset minimum saturation value can be any set value, wherein preferably, the preset minimum saturation value can be 5%, because when the saturation is lower than 5%, the color is too white and the effect is not good; and the saturation cannot be 0%, because if the saturation is 0%, no matter what the hue and brightness values are, the color is white.
[0065] In the deepening operation, since the saturation of the target color is within the maximum preset saturation range, the saturation is large enough, and the saturation of each second adjacent color can be directly maintained equal to the preset maximum saturation value, where the preset maximum saturation value can be 100%, of course, it can also be other values, such as 98%, 95%, which is not limited here.
[0066] The second case: if the saturation of the target color is in the middle preset saturation range, during the lightening operation, the saturation is reduced from the saturation of the target color to a second step length of a preset minimum saturation value, and the saturation of each of the first adjacent colors is set in sequence according to the second step length; and / or, during the darkening operation, the saturation is increased from the saturation of the target color to a third step length of a preset maximum saturation value, and the saturation of each of the second adjacent colors is set in sequence according to the third step length.
[0067] In this embodiment, the intermediate preset saturation range can be 95% ≥ S > 30%, and of course it can also be other ranges. When the saturation of the target color is within the intermediate preset saturation range, in the lightening operation, the saturation of each first adjacent color can be set by decreasing the saturation in a second step based on the saturation of the target color, wherein the second step can be determined by the saturation of the target color, the preset minimum saturation value and the number of first adjacent colors. The process can be the same as the first case and will not be repeated here.
[0068] In the deepening operation, the saturation of each second adjacent color can be set by increasing the saturation in a third step based on the saturation of the target color, wherein the third step can be determined by the saturation of the target color, the preset maximum saturation value, and the number of second adjacent colors, that is, the saturation of the second adjacent color increases from the saturation of the target color to the step of the preset maximum saturation value, which is equal to the ratio of the difference between the preset maximum saturation value and the saturation of the target color to the number of second adjacent colors. It should be noted that the preset maximum saturation value can be any set value, wherein preferably, the preset maximum saturation value can be 100%, and of course it can also be other values, such as 98%, 95%, which are not limited here.
[0069] The third case: if the saturation of the target color is within the minimum preset saturation range, the saturation of each of the first adjacent colors is kept equal to the saturation of the target color during the lightening operation; and / or, during the darkening operation, the saturation is increased from the saturation of the target color to a fourth step length at which the saturation is a preset maximum saturation value, and the saturation of each of the second adjacent colors is set in sequence according to the fourth step length.
[0070] In this embodiment, the minimum preset saturation range can be 30% ≥ S > 0%, and of course it can also be other ranges. When the saturation of the target color is in the minimum preset saturation range, in the lightening operation, since the saturation of the target color is relatively small, the saturation of each first adjacent color can be directly maintained equal to the saturation of the target color. Of course, it can also be equal to other values, such as 10%, 5%, etc., which is not limited here.
[0071] In the deepening operation, the saturation of each second adjacent color can be set by increasing the saturation in a fourth step based on the saturation of the target color, wherein the fourth step can be determined by the saturation of the target color, the preset maximum saturation value and the number of second adjacent colors. The process is the same as the third case and will not be repeated here.
[0072] Fourth situation: if the saturation of the target color is 0%, the saturation of each of the first adjacent color and / or the second adjacent color is kept equal to 0% during the lightening operation and / or darkening operation.
[0073] In this embodiment, since the hue and brightness are all gray when the saturation is 0%, it is sufficient to keep the saturation at 0% during the lightening operation and / or darkening operation.
[0074] As an example, assume that the maximum preset saturation range is 100% ≥ S > 95%, the middle preset saturation range is 95% ≥ S > 30%, and the minimum preset saturation range is 30% ≥ S > 0%. The target color is the sixth color of the color palette, and there are 5 first adjacent colors, that is, when the lightening operation is performed, it is necessary to lighten 5 color levels based on the target color, and there are 4 second adjacent colors, that is, when the darkening operation is performed, it is necessary to darken 4 color levels based on the target color. For the convenience of expression, Table 1 in this embodiment shows the target preset saturation setting rules corresponding to the above-mentioned preset saturation ranges, where the saturation S of the target color = x.
[0075] Table 1
[0076]
[0077] On the basis of any of the above embodiments, at least three preset brightness ranges may be preset within the brightness interval of 0 to 100%, and the at least three preset brightness ranges include a maximum preset brightness range, an intermediate preset brightness range, and a minimum preset brightness range; optionally, the maximum preset brightness range may be 100% ≥ S > 95%, the intermediate preset brightness range may be 95% ≥ S > 30%, and the minimum preset brightness range may be 30% ≥ S > 0. Of course, the above-mentioned manner of dividing the range intervals is not limited in this embodiment, and more ranges may be divided, and are not limited to three ranges.
[0078] In this embodiment, when the brightness of each of the first adjacent colors and / or each of the second adjacent colors is sequentially acquired according to the target preset brightness setting rule, it can be divided into at least the following situations:
[0079] The first case: if the brightness of the target color is within the maximum preset brightness range, the brightness of each of the first adjacent colors is kept equal to the preset maximum brightness value during the lightening operation; and / or, during the darkening operation, a fifth step is obtained in which the brightness is reduced from the brightness of the target color to the preset minimum brightness value, and the brightness of each of the second adjacent colors is set in sequence according to the fifth step.
[0080] In this embodiment, the maximum preset brightness range can be 100% ≥ S > 95%, and of course it can also be other ranges. When the brightness of the target color is within the maximum preset brightness range, in the fade operation, the brightness of the target color can be within the maximum preset brightness range. The brightness is large enough and the brightness of each second adjacent color can be directly maintained equal to the preset maximum brightness value, where the preset maximum brightness value can be 100%, and of course it can be other values, such as 98%, 95%, which is not limited here.
[0081] In the deepening operation, the brightness of each second adjacent color can be set by decreasing the brightness in the fifth step based on the brightness of the target color, wherein the fifth step can be determined by the brightness of the target color, the preset minimum brightness value and the number of second adjacent colors, that is, the step size of the brightness of the second adjacent color from the brightness of the target color to the preset minimum brightness value is equal to the ratio of the difference between the brightness of the target color and the preset minimum brightness value to the number of second adjacent colors. It should be noted that the preset minimum brightness value can be any set value, wherein preferably, the preset minimum brightness value can be 30%, because when the brightness is lower than 30%, the color is too dark and the effect is not good; and the brightness cannot be 0%, because if the brightness is 0%, no matter what the hue and brightness value are, the color is black.
[0082] The second case: if the brightness of the target color is in the middle preset brightness range, during the lightening operation, a sixth step length is obtained in which the brightness increases from the brightness of the target color to a preset maximum brightness value, and the brightness of each of the first adjacent colors is set in sequence according to the sixth step length; and / or, during the darkening operation, a seventh step length is obtained in which the brightness decreases from the brightness of the target color to a preset minimum brightness value, and the brightness of each of the second adjacent colors is set in sequence according to the seventh step length.
[0083] In this embodiment, the intermediate preset brightness range can be 95% ≥ S > 30%, and of course it can also be other ranges. When the brightness of the target color is within the intermediate preset brightness range, in the fade operation, the brightness of each first adjacent color can be set by increasing the brightness by the sixth step based on the brightness of the target color, wherein the sixth step can be determined by the brightness of the target color, the preset maximum brightness value, and the number of first adjacent colors, that is, the step size of the brightness of the second adjacent color from the brightness of the target color to the preset maximum brightness value is equal to the ratio of the difference between the preset maximum brightness value and the brightness of the target color to the number of second adjacent colors. It should be noted that the preset maximum brightness value can be any set value, wherein preferably, the preset maximum brightness value can be 100%, and of course it can also be other values, such as 98%, 95%, which are not limited here.
[0084] During the deepening operation, the brightness of each second adjacent color can be set by decreasing the brightness in the seventh step based on the brightness of the target color, wherein the seventh step can be determined by the brightness of the target color, the preset minimum brightness value and the number of second adjacent colors. The process is the same as the first case and will not be repeated here.
[0085] The third case: if the brightness of the target color is within the minimum preset brightness range, an eighth step length is obtained in which the brightness increases from the brightness of the target color to the preset maximum brightness value during the lightening operation, and the brightness of each of the first adjacent colors is set in sequence according to the eighth step length; and / or, the brightness of each of the second adjacent colors is kept equal to the brightness of the target color during the darkening operation.
[0086] In this embodiment, the minimum preset brightness range can be 30% ≥ S > 0%, and of course it can also be other ranges. When the brightness of the target color is in the minimum preset brightness range, in the fade operation, the brightness of each first adjacent color can be set by increasing the brightness in eighth steps based on the brightness of the target color, where the eighth step can be determined by the brightness of the target color, the preset maximum brightness value and the number of first adjacent colors. The process can be the same as the second case and will not be repeated here.
[0087] In the deepening operation, since the brightness of the target color is within the minimum preset brightness range, the brightness is small enough, and the brightness of each second adjacent color can be directly kept equal to the brightness of the target color. Of course, it can also be equal to other values, such as 30%, 25%, etc., which is not limited here.
[0088] The fourth case: if the brightness of the target color is 0%, then in the lightening operation, a ninth step is obtained in which the brightness increases from the brightness of the target color to a preset maximum brightness value, and the brightness of each of the first adjacent colors is set in sequence according to the ninth step; and / or, in the darkening operation, the brightness of each of the second adjacent colors is kept equal to 0%.
[0089] In this embodiment, since the hue and saturation values are all black when the brightness is 0%, it is only necessary to continue to maintain the brightness at 0% during the darkening operation. Optionally, the hue and saturation can also be adjusted to 0. In the lightening operation, the brightness of each first adjacent color can be set by increasing the brightness by a ninth step based on the brightness of the target color, wherein the ninth step can be determined by the brightness of the target color, the preset maximum brightness value, and the number of first adjacent colors. The process is the same as the second case and will not be repeated here.
[0090] As an example, assuming that the maximum preset brightness range is 100% ≥ B > 95%, the middle preset brightness range is 95% ≥ B > 30%, and the minimum preset brightness range is 30% ≥ B > 0%, the target color is the sixth color of the color palette, and there are 5 first adjacent colors, that is, when the lightening operation is performed, it is necessary to lighten 5 color levels based on the target color, and there are 4 second adjacent colors, that is, when the darkening operation is performed, it is necessary to darken 4 color levels based on the target color. For the convenience of expression, Table 2 in this embodiment shows the target preset brightness setting rules corresponding to the above-mentioned preset brightness ranges, where the brightness of the target color B = y.
[0091] Table 2
[0092] Dodge operation (5 levels) Darkening operation (4 levels) 100%≥B>95% 100% -(y-30%)÷4 95%≥B>30% +(100%-y)÷5 -(y-30%)÷4 30%≥B>0% +(100%-y)÷5 constant B=0 +(100%-y)÷5 B=0
[0093] On the basis of any of the above embodiments, when the hues of the first adjacent colors and / or the second adjacent colors are sequentially acquired according to the target preset hue setting rule, it can be divided into at least the following situations:
[0094] The first case: if the hue of the target color corresponds to a maximum value on the luminosity-hue relationship diagram, the hue of each of the first adjacent colors is kept equal to the hue of the target color during the lightening operation; and / or, the hue of each of the second adjacent colors is increased or decreased in sequence by a preset tenth step during the darkening operation.
[0095] In this embodiment, according to Figure 5 As shown in the luminosity-hue relationship diagram, there are three maximum values (high points) in the luminosity-hue relationship diagram, namely yellow, cyan, and magenta, and the hues are 60°, 180°, and 300°, respectively. When the hue of the target color is 60°, 180°, and 300°, in the lightening operation, since the color at the maximum value is already lighter, and increasing or decreasing the hue may cause the color to darken, the hue of each first adjacent color can be kept equal to the hue of the target color, that is, the hue of the color at the maximum value in the lightening operation. In the darkening operation, the hue value can be increased or decreased in sequence based on the hue of the target color with a preset tenth step length as the hue of each second adjacent color, wherein the increase or decrease process is in the direction of the hue corresponding to the nearest minimum value, so the color can be darkened, wherein the tenth step length can be any value, which can be set according to the actual situation, and the optional tenth step length can be 2°.
[0096] The second case: if the hue of the target color corresponds to the minimum value on the luminosity-hue relationship diagram, then during the lightening operation, the hue of each of the first adjacent colors is increased or decreased in sequence with a preset tenth step length; and / or, during the darkening operation, the hue of each of the second adjacent colors is kept equal to the hue of the target color.
[0097] In this embodiment, according to Figure 5 The luminosity-hue relationship diagram shown in the figure has three minimum values (low points), namely red, green, and blue, and the hues are 0°, 120°, and 240°, respectively. When the hue of the target color is 0°, 120°, and 240°, in the darkening operation, since the color at the minimum value is already darker, increasing or decreasing the hue may cause the color to fade. Therefore, the hue of the second adjacent color can be kept equal to the hue of the target color, that is, the hue of the color at the minimum value, in the darkening operation. In the lightening operation, the hue value can be sequentially increased or decreased by the preset tenth step length based on the hue of the target color as the hue of each first adjacent color, wherein the increase or decrease process is in the direction of the hue corresponding to the nearest maximum value, so the color can be faded.
[0098] The third case: if the hue of the target color does not correspond to the extreme value on the luminosity-hue relationship diagram, the nearest maximum and / or minimum is determined; during the lightening operation, the hue of each of the first adjacent colors is set to increase or decrease in sequence in the direction of the hue corresponding to the nearest maximum value with a preset tenth step length; and / or, during the darkening operation, the hue of each of the second adjacent colors is set to increase or decrease in sequence in the direction of the hue corresponding to the nearest minimum value with a preset tenth step length.
[0099] In this embodiment, when the hue of the target color does not correspond to the extreme value on the luminosity-hue relationship diagram, that is, does not correspond to the maximum value and the minimum value, the hue of each first adjacent color is set to increase or decrease in sequence in the direction of the hue corresponding to the nearest maximum value with a preset tenth step length during the fading operation. For example, see Figure 5 In the luminosity-hue relationship diagram shown, when the hue of the target color is between 60° and 120°, the hue of its nearest maximum value is 60°, so the hue of the first adjacent color should decrease in the tenth step toward 60°; and when the hue of the target color is between 120° and 180°, the hue of its nearest maximum value is 180°, so the hue of the first adjacent color should increase in the tenth step toward 180°. Similarly, during the darkening operation, the hue of each second adjacent color is set to increase or decrease in the direction of the hue corresponding to the nearest minimum value in the preset tenth step. For example, see Figure 5 In the luminosity-hue relationship diagram shown, when the hue of the target color is between 60° and 120°, the hue at its nearest minimum value is 120°, so the hue of the second adjacent color should increase toward 60° in the tenth step; and when the hue of the target color is between 120° and 180°, the hue at its nearest maximum value is 120°, so the hue of the second adjacent color should decrease toward 120° in the tenth step.
[0100] Further, in the above embodiment, when the hue of each of the first adjacent colors is set to increase or decrease in sequence in the direction of the hue corresponding to the nearest maximum value in the preset tenth step length during the lightening operation, if the hue of any of the first adjacent colors increases or decreases to the hue corresponding to the nearest maximum value, the hue of the subsequent first adjacent colors remains the hue corresponding to the nearest maximum value. In this embodiment, when the hue of the target color is within a preset interval near the maximum value (which can be determined according to actual conditions), during the lightening operation, the hue of each of the first adjacent colors may first increase or decrease in sequence to the hue corresponding to the maximum value, that is, toward the hue corresponding to the maximum value, and then continue to increase or decrease and move away from the hue corresponding to the maximum value again, which may cause the first adjacent color to be deepened again. Therefore, in this embodiment, when the hue of the first adjacent color increases or decreases to the hue corresponding to the nearest maximum value, the hue of the subsequent first adjacent color remains the hue corresponding to the nearest maximum value and no longer continues to increase or decrease.
[0101] Similarly, when the hue of each second adjacent color is set to increase or decrease in sequence in the direction of the hue corresponding to the nearest minimum value in the preset tenth step length during the deepening operation, if the hue of any second adjacent color increases or decreases to the hue corresponding to the nearest minimum value, the hue of the subsequent second adjacent color remains the hue corresponding to the nearest minimum value. In this embodiment, when the hue of the target color is within a preset interval near the minimum value, during the deepening operation, the hue of each second adjacent color may first increase or decrease in sequence to the hue corresponding to the minimum value, that is, toward the hue corresponding to the minimum value, and then continue to increase or decrease and move away from the hue corresponding to the minimum value again, which may cause the second adjacent color to be faded again. Therefore, in this embodiment, when the hue of the second adjacent color increases or decreases to the hue corresponding to the nearest minimum value, the hue of the subsequent second adjacent color remains the hue corresponding to the nearest minimum value and no longer continues to increase or decrease.
[0102] In one embodiment, the maximum preset hue range is 100% ≥ B > 95%, the middle preset hue range is 95% ≥ B > 30%, and the minimum preset hue range is 30% ≥ B > 0%. Taking the target color as the sixth color of the color palette, there are 5 first adjacent colors, that is, when the lightening operation is performed, it is necessary to lighten 5 color levels based on the target color, and there are 4 second adjacent colors, that is, when the darkening operation is performed, it is necessary to darken 4 color levels based on the target color. For the convenience of expression, Table 3 in this embodiment shows the target preset hue setting rules corresponding to the above-mentioned preset hue ranges.
[0103] Table 3
[0104]
[0105] In addition, as an example, when the hue H of the target color satisfies: 360°(0°)≥H>352°, the hue is gradually reduced by -2° when it is lightened, and gradually increased by +2 when it is darkened, until the hue remains unchanged after it increases to 360°; similarly, when 240°≥H>232°, the hue is gradually reduced by -2° when it is lightened, and gradually increased by +2 when it is darkened, until the hue remains unchanged after it increases to 240°; when 120°≥H>112°, the hue is gradually reduced by -2° when it is lightened, and gradually increased by +2 when it is darkened, until the hue remains unchanged after it increases to 120°;
[0106] Similarly, when the hue H of the target color satisfies: 8°>H>0° or 248°>H>240° or 128°>H>120°, the hue is gradually increased by +2° when it is lightened, and gradually decreased by -2 when it is darkened to the minimum value (0°, 120°, 240°) and then remains unchanged;
[0107] When the hue H of the target color satisfies: 70°>H≥60° or 190°>H≥180° or 310°>H≥300°, the hue will gradually decrease by -2 to the maximum value (60°, 180°, 300°) when lightening, and then remain unchanged, while the hue will gradually increase by +2° when darkening.
[0108] When the hue H of the target color satisfies: 60°>H>50° or 80°>H>170° or 300°>H>290°, the lighter hue is gradually increased by +2 to the maximum value (60°, 180°, 300°) and then remains unchanged, while the darker hue is gradually increased by -2°.
[0109] When the hue of the target color is at the hue corresponding to the maximum point or in a predetermined interval nearby, the brightness is the brightest, so when the color is deepened, the hue of the second adjacent color gradually increases by ±2° based on the hue of the target color, and when the color is lightened, the hue of the first adjacent color remains unchanged; and when the hue of the target color is at the hue corresponding to the minimum point or in a predetermined interval nearby, the brightness is the darkest, the hue of the second adjacent color remains unchanged when the color is deepened, and when the color is lightened, the hue of the first adjacent color gradually increases by ±2° based on the hue of the target color. Through the above operations, the color palette can be avoided from appearing like this Figure 6a The cross-color gamut phenomenon shown in FIG. 1 is shown in FIG. 1 , and the color palette obtained in this embodiment is as follows: Figure 6b As shown, Figure 6b No gamut crossing occurs.
[0110] It should be noted that, in the above embodiments, the saturation, brightness and hue of each first adjacent color and / or each second adjacent color are explained and illustrated separately. In actual application, it may be necessary to obtain the saturation, brightness and hue of the first adjacent color and / or each second adjacent color at the same time. In this case, the processes of the above embodiments can be performed at the same time. Figure 7As shown, after the saturation S, brightness B and hue H of the sixth color (target color) are given, the other nine adjacent colors on the color palette can be obtained at once.
[0111] In addition, in the above embodiment, when setting the saturation, brightness and hue, if the result is a decimal, the value before the decimal point is retained instead of rounding. In addition, the selection of the target color is also very important. Generally, a target color with higher saturation and higher brightness can better match the above rules.
[0112] Figure 8 : is a structural diagram of the interface color setting device according to an embodiment of the present invention. The interface color setting device provided in this embodiment can execute the processing flow provided in the method embodiment, such as Figure 8 As shown, the interface color setting device 800 includes a receiving module 801 , a color palette obtaining module 802 , and a setting module 803 .
[0113] A receiving module 801 is used to receive a color setting instruction from a user, wherein the color setting instruction includes color parameters of a target color set by the user;
[0114] A color palette acquisition module 802 is used to generate a color palette according to the color parameters of the target color and a preset color palette generation rule, wherein the color palette includes the target color and a plurality of adjacent colors of the target color, wherein the adjacent colors are lighter and / or darker than the target color;
[0115] The setting module 803 is used to set the color of each object in the interface according to the color palette and the preset mapping relationship between each object in the interface and each color position in the color palette.
[0116] Based on any of the above embodiments, when generating a color palette according to the color parameters of the target color and a preset color palette generation rule, the color palette acquisition module 802 is used to:
[0117] According to the color parameters of the target color and the preset color palette generation rule, gradually performing a lightening operation and / or a darkening operation on the target color to obtain a first preset number of first adjacent colors and / or a second preset number of second adjacent colors;
[0118] The first adjacent color, the target color, and the second adjacent color are sorted according to the depth of the colors to obtain the color palette.
[0119] Based on any of the above embodiments, the color parameters of the target color include hue, saturation and brightness;
[0120] When the color palette acquisition module 802 gradually performs a lightening operation and / or a darkening operation on the target color according to the color parameters of the target color and the preset color palette generation rule to obtain a first preset number of first adjacent colors and / or a second preset number of second adjacent colors, respectively, it is used to:
[0121] According to the hue, saturation and brightness of the target color, the corresponding target preset saturation setting rule, target preset brightness setting rule, and target preset hue setting rule in the color palette generation rule are determined respectively, and the saturation, brightness and hue of each of the first adjacent colors and / or each of the second adjacent colors are obtained in turn according to these rules.
[0122] On the basis of any of the above embodiments, at least three preset saturation ranges are preset in the saturation interval of 0 to 100%, and the at least three preset saturation ranges include a maximum preset saturation range, a middle preset saturation range, and a minimum preset saturation range;
[0123] When the color palette acquisition module 802 sequentially acquires the saturation of each of the first adjacent colors and / or each of the second adjacent colors according to the target preset saturation setting rule, it is used to:
[0124] If the saturation of the target color is within the maximum preset saturation range, in a lightening operation, a first step length for reducing the saturation from the saturation of the target color to a preset minimum saturation value is obtained, and the saturation of each of the first adjacent colors is sequentially set according to the first step length; and / or, in a darkening operation, the saturation of each of the second adjacent colors is maintained equal to the preset maximum saturation value; or
[0125] If the saturation of the target color is in the middle preset saturation range, in a lightening operation, a second step length is obtained in which the saturation is reduced from the saturation of the target color to a saturation of a preset minimum saturation value, and the saturation of each of the first adjacent colors is sequentially set according to the second step length; and / or, in a darkening operation, a third step length is obtained in which the saturation is increased from the saturation of the target color to a saturation of a preset maximum saturation value, and the saturation of each of the second adjacent colors is sequentially set according to the third step length; or
[0126] If the saturation of the target color is within the minimum preset saturation range, maintaining the saturation of each of the first adjacent colors equal to the saturation of the target color during the lightening operation; and / or, obtaining a fourth step length in which the saturation increases from the saturation of the target color to a saturation of a preset maximum saturation value during the darkening operation, and sequentially setting the saturation of each of the second adjacent colors according to the fourth step length; or
[0127] If the saturation of the target color is 0%, the saturation of each of the first adjacent color and / or the second adjacent color is kept equal to 0% during the lightening operation and / or darkening operation.
[0128] On the basis of any of the above embodiments, at least three preset brightness ranges are preset in the brightness interval of 0-100%, and the at least three preset brightness ranges include a maximum preset brightness range, a middle preset brightness range and a minimum preset brightness range;
[0129] When the color palette acquisition module 802 sequentially acquires the brightness of each of the first adjacent colors and / or each of the second adjacent colors according to the target preset brightness setting rule, it is used to:
[0130] If the brightness of the target color is within the maximum preset brightness range, maintaining the brightness of each of the first adjacent colors equal to the preset maximum brightness value during the lightening operation; and / or obtaining a fifth step length for reducing the brightness from the brightness of the target color to the preset minimum brightness value during the darkening operation, and sequentially setting the brightness of each of the second adjacent colors according to the fifth step length; or
[0131] If the brightness of the target color is in the middle preset brightness range, in a lightening operation, a sixth step length is obtained in which the brightness increases from the brightness of the target color to a preset maximum brightness value, and the brightness of each of the first adjacent colors is sequentially set according to the sixth step length; and / or, in a darkening operation, a seventh step length is obtained in which the brightness decreases from the brightness of the target color to a preset minimum brightness value, and the brightness of each of the second adjacent colors is sequentially set according to the seventh step length; or
[0132] If the brightness of the target color is within the minimum preset brightness range, in a lightening operation, an eighth step length is obtained in which the brightness increases from the brightness of the target color to a preset maximum brightness value, and the brightness of each of the first adjacent colors is sequentially set according to the eighth step length; and / or, in a darkening operation, the brightness of each of the second adjacent colors is kept equal to the brightness of the target color; or
[0133] If the brightness of the target color is 0%, then during the lightening operation, a ninth step length is obtained in which the brightness increases from the brightness of the target color to a preset maximum brightness value, and the brightness of each of the first adjacent colors is set in sequence according to the ninth step length; and / or, during the darkening operation, the brightness of each of the second adjacent colors is kept equal to 0%.
[0134] Based on any of the above embodiments, when the color palette acquisition module 802 sequentially acquires the hue of each of the first adjacent colors and / or each of the second adjacent colors according to the target preset hue setting rule, it is used to:
[0135] If the hue of the target color corresponds to a maximum value on the luminance-hue relationship diagram, the hue of each of the first adjacent colors is kept equal to the hue of the target color during the lightening operation; and / or, the hue of each of the second adjacent colors is sequentially increased or decreased by a preset tenth step length during the darkening operation; or
[0136] If the hue of the target color corresponds to a minimum value on the luminosity-hue relationship diagram, then in a lightening operation, the hue of each of the first adjacent colors is sequentially increased or decreased by a preset tenth step length; and / or, in a darkening operation, the hue of each of the second adjacent colors is kept equal to the hue of the target color; or
[0137] If the hue of the target color does not correspond to an extreme value on the luminosity-hue relationship diagram, the nearest maximum and / or minimum is determined; during a lightening operation, the hue of each of the first adjacent colors is set to increase or decrease in sequence in the direction of the hue corresponding to the nearest maximum value with a preset tenth step length; and / or, during a darkening operation, the hue of each of the second adjacent colors is set to increase or decrease in sequence in the direction of the hue corresponding to the nearest minimum value with a preset tenth step length.
[0138] Based on any of the above embodiments, when the color palette acquisition module 802 sets the hue of each of the first adjacent colors to increase or decrease in sequence in a preset tenth step toward the direction of the hue corresponding to the nearest maximum value during the lightening operation, it is further configured to:
[0139] If the hue of any of the first adjacent colors increases or decreases to the hue corresponding to the nearest maximum value during the lightening operation, the hue of the subsequent first adjacent colors remains at the hue corresponding to the nearest maximum value; and / or
[0140] When the hue of each of the second adjacent colors is set to increase or decrease in sequence in a preset tenth step toward the direction of the hue corresponding to the nearest minimum value during the deepening operation, it also includes:
[0141] If the hue of any of the second adjacent colors increases or decreases to the hue corresponding to the nearest minimum value during the darkening operation, the hue of the subsequent second adjacent colors remains at the hue corresponding to the nearest minimum value.
[0142] The interface color setting device provided in the embodiment of the present invention can be specifically used to perform the above Figure 2-3 The specific functions of the provided method embodiment will not be repeated here.
[0143] The interface color setting device provided by the embodiment of the present invention receives a color setting instruction from a user, wherein the color setting instruction includes the color parameters of a target color set by the user; generates a color palette according to the color parameters of the target color and a preset color palette generation rule, wherein the color palette includes the target color and a plurality of adjacent colors of the target color, wherein the adjacent colors are lighter and / or darker colors than the target color; and sets the color of each object in the interface according to the color palette and the preset mapping relationship between each object in the interface and each color position in the color palette. In this embodiment, during the interface design and development process, the user only needs to determine the target color to obtain a plurality of other adjacent colors and generate a color palette, and then the automatic design of the interface color can be realized according to the mapping relationship between the color palette and each object in the interface and each color position in the color palette, which can unify the color standard of the interface design, improve the efficiency of the interface design and development, save human resources, and avoid the single color change caused by simply modifying the black and white values in the color, which makes the interface color matching uncoordinated and lacks aesthetics, affecting the interface display effect.
[0144] Fig. 9 The electronic device provided by the embodiment of the present invention can execute the processing flow provided by the embodiment of the interface color setting method, such as Fig. 9 As shown, the electronic device 90 includes a memory 91, a processor 92, and a computer program; wherein the computer program is stored in the memory 91 and is configured to execute the interface color setting method described in the above embodiment by the processor 92. In addition, the electronic device 90 may also have a communication interface 93 for receiving control instructions.
[0145] Fig. 9 The electronic device of the illustrated embodiment can be used to execute the technical solution of the above-mentioned interface color setting method embodiment, and its implementation principle and technical effect are similar and will not be repeated here.
[0146] In addition, this embodiment further provides a computer-readable storage medium on which a computer program is stored. The computer program is executed by a processor to implement the interface color setting method described in the above embodiment.
[0147] In the several embodiments provided in the embodiments of the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0148] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0149] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0150] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0151] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0152] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the embodiments of the present invention have been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for setting interface color, It is characterized in that include: receiving a color setting instruction from a user, wherein the color setting instruction includes color parameters of a target color set by the user; According to the color parameters of the target color and the preset color palette generation rules, the target color is gradually subjected to a lightening operation and / or a darkening operation to obtain a first preset number of first adjacent colors and / or a second preset number of second adjacent colors, respectively, the color parameters of the target color include hue, saturation and brightness, the preset color palette generation rules include a preset saturation setting rule, a preset brightness setting rule, and a preset hue setting rule, the hue, saturation and brightness are respectively set with different intervals, and the target color is subjected to a lightening operation and / or a darkening operation corresponding to different setting rules in different intervals; Sort the first adjacent color, the target color, and the second adjacent color according to the depth of the colors to generate a color palette, wherein the color palette includes the target color and a plurality of adjacent colors of the target color, wherein the adjacent colors are lighter and / or darker than the target color; According to the color palette and the mapping relationship between each object in the preset interface and each color position in the color palette, setting the color of each object in the interface; At least three preset saturation ranges are preset in the saturation interval of 0 to 100%, and the at least three preset saturation ranges include a maximum preset saturation range, an intermediate preset saturation range, and a minimum preset saturation range. The step of gradually performing a lightening operation and / or a darkening operation on the target color includes: When the target color is in different ranges, different step sizes are used to perform a lightening operation and / or a darkening operation on the target color, and the step sizes corresponding to the lightening operation and the darkening operation in the same range are different. The step size corresponding to the lightening operation is determined based on the saturation of the target color, the preset minimum saturation value, and the number of the first adjacent colors, and the step size corresponding to the darkening operation is determined based on the saturation of the target color, the preset maximum saturation value, and the number of the second adjacent colors.
2. The method according to claim 1, It is characterized in that The step of gradually performing a lightening operation and / or a darkening operation on the target color according to the color parameter of the target color and a preset color palette generation rule to obtain a first preset number of first adjacent colors and / or a second preset number of second adjacent colors respectively includes: According to the hue, saturation and brightness of the target color, the corresponding target preset saturation setting rule, target preset brightness setting rule, and target preset hue setting rule in the color palette generation rule are determined respectively, and the saturation, brightness and hue of each of the first adjacent colors and / or each of the second adjacent colors are obtained in turn according to these rules.
3. The method according to claim 2, It is characterized in that At least three preset saturation ranges are preset within the saturation interval of 0 to 100%, and the at least three preset saturation ranges include a maximum preset saturation range, a middle preset saturation range, and a minimum preset saturation range; The saturation of each of the first adjacent colors and / or each of the second adjacent colors is sequentially acquired according to a target preset saturation setting rule, including: If the saturation of the target color is within the maximum preset saturation range, in a lightening operation, a first step length for reducing the saturation from the saturation of the target color to a preset minimum saturation value is obtained, and the saturation of each of the first adjacent colors is sequentially set according to the first step length; and / or, in a darkening operation, the saturation of each of the second adjacent colors is maintained equal to the preset maximum saturation value; or If the saturation of the target color is in the middle preset saturation range, in a lightening operation, a second step length is obtained in which the saturation is reduced from the saturation of the target color to a saturation of a preset minimum saturation value, and the saturation of each of the first adjacent colors is sequentially set according to the second step length; and / or, in a darkening operation, a third step length is obtained in which the saturation is increased from the saturation of the target color to a saturation of a preset maximum saturation value, and the saturation of each of the second adjacent colors is sequentially set according to the third step length; or If the saturation of the target color is within the minimum preset saturation range, maintaining the saturation of each of the first adjacent colors equal to the saturation of the target color during the lightening operation; and / or, obtaining a fourth step length in which the saturation increases from the saturation of the target color to a saturation of a preset maximum saturation value during the darkening operation, and sequentially setting the saturation of each of the second adjacent colors according to the fourth step length; or If the saturation of the target color is 0%, the saturation of each of the first adjacent color and / or the second adjacent color is kept equal to 0% during the lightening operation and / or darkening operation.
4. The method according to claim 2, It is characterized in that At least three preset brightness ranges are preset within the brightness interval of 0-100%, and the at least three preset brightness ranges include a maximum preset brightness range, an intermediate preset brightness range, and a minimum preset brightness range; The brightness of each of the first adjacent colors and / or each of the second adjacent colors is sequentially acquired according to a target preset brightness setting rule, including: If the brightness of the target color is within the maximum preset brightness range, maintaining the brightness of each of the first adjacent colors equal to the preset maximum brightness value during the lightening operation; and / or obtaining a fifth step length for reducing the brightness from the brightness of the target color to the preset minimum brightness value during the darkening operation, and sequentially setting the brightness of each of the second adjacent colors according to the fifth step length; or If the brightness of the target color is in the middle preset brightness range, in a lightening operation, a sixth step length is obtained in which the brightness increases from the brightness of the target color to a preset maximum brightness value, and the brightness of each of the first adjacent colors is sequentially set according to the sixth step length; and / or, in a darkening operation, a seventh step length is obtained in which the brightness decreases from the brightness of the target color to a preset minimum brightness value, and the brightness of each of the second adjacent colors is sequentially set according to the seventh step length; or If the brightness of the target color is within the minimum preset brightness range, in a lightening operation, an eighth step length is obtained in which the brightness increases from the brightness of the target color to a preset maximum brightness value, and the brightness of each of the first adjacent colors is sequentially set according to the eighth step length; and / or, in a darkening operation, the brightness of each of the second adjacent colors is kept equal to the brightness of the target color; or If the brightness of the target color is 0%, then during the lightening operation, a ninth step length is obtained in which the brightness increases from the brightness of the target color to a preset maximum brightness value, and the brightness of each of the first adjacent colors is set in sequence according to the ninth step length; and / or, during the darkening operation, the brightness of each of the second adjacent colors is kept equal to 0%.
5. The method according to claim 2, It is characterized in that Sequentially acquiring the hue of each of the first adjacent colors and / or each of the second adjacent colors according to a target preset hue setting rule includes: If the hue of the target color corresponds to a maximum value on the luminance-hue relationship diagram, the hue of each of the first adjacent colors is kept equal to the hue of the target color during the lightening operation; and / or, the hue of each of the second adjacent colors is sequentially increased or decreased by a preset tenth step length during the darkening operation; or If the hue of the target color corresponds to a minimum value on the luminosity-hue relationship diagram, then in a lightening operation, the hue of each of the first adjacent colors is sequentially increased or decreased by a preset tenth step length; and / or, in a darkening operation, the hue of each of the second adjacent colors is kept equal to the hue of the target color; or If the hue of the target color does not correspond to an extreme value on the luminosity-hue relationship diagram, the nearest maximum and / or minimum is determined; during a lightening operation, the hue of each of the first adjacent colors is set to increase or decrease in sequence in the direction of the hue corresponding to the nearest maximum value with a preset tenth step length; and / or, during a darkening operation, the hue of each of the second adjacent colors is set to increase or decrease in sequence in the direction of the hue corresponding to the nearest minimum value with a preset tenth step length.
6. The method according to claim 5, It is characterized in that When the hue of each of the first adjacent colors is set to increase or decrease in sequence in a preset tenth step toward the direction of the hue corresponding to the nearest maximum value during the lightening operation, it also includes: If the hue of any of the first adjacent colors increases or decreases to the hue corresponding to the nearest maximum value during the lightening operation, the hue of the subsequent first adjacent colors remains at the hue corresponding to the nearest maximum value; and / or When the hue of each of the second adjacent colors is set to increase or decrease in sequence in a preset tenth step toward the direction of the hue corresponding to the nearest minimum value during the deepening operation, it also includes: If the hue of any of the second adjacent colors increases or decreases to the hue corresponding to the nearest minimum value during the darkening operation, the hue of the subsequent second adjacent colors remains at the hue corresponding to the nearest minimum value.
7. An interface color setting device, It is characterized in that include: A receiving module, used for receiving a color setting instruction from a user, wherein the color setting instruction includes color parameters of a target color set by the user; A color palette acquisition module, used to generate a color palette according to the color parameters of the target color and a preset color palette generation rule, wherein the color palette includes the target color and a plurality of adjacent colors of the target color, wherein the adjacent colors are lighter and / or darker than the target color; A setting module, used to set the color of each object in the interface according to the color palette and a preset mapping relationship between each object in the interface and each color position in the color palette; When generating a color palette according to the color parameters of the target color and a preset color palette generation rule, the color palette acquisition module is used to: According to the color parameters of the target color and the preset color palette generation rule, gradually performing a lightening operation and / or a darkening operation on the target color to obtain a first preset number of first adjacent colors and / or a second preset number of second adjacent colors; Sort the first adjacent color, the target color, and the second adjacent color according to the depth of the colors to obtain the color palette; The color parameters of the target color include hue, saturation and brightness, the preset color palette generation rule includes a preset saturation setting rule, a preset brightness setting rule, and a preset hue setting rule, the hue, saturation and brightness are respectively set with different intervals, and the target color is lightened and / or darkened according to different setting rules in different intervals; At least three preset saturation ranges are preset in the saturation interval of 0 to 100%, and the at least three preset saturation ranges include a maximum preset saturation range, an intermediate preset saturation range, and a minimum preset saturation range. When the color palette acquisition module gradually performs a lightening operation and / or a darkening operation on the target color, it is specifically used to: When the target color is in different ranges, different step sizes are used to perform a lightening operation and / or a darkening operation on the target color, and the step sizes corresponding to the lightening operation and the darkening operation in the same range are different. The step size corresponding to the lightening operation is determined based on the saturation of the target color, the preset minimum saturation value, and the number of the first adjacent colors, and the step size corresponding to the darkening operation is determined based on the saturation of the target color, the preset maximum saturation value, and the number of the second adjacent colors.
8. The device according to claim 7, It is characterized in that The color palette acquisition module is used to: when gradually performing a lightening operation and / or a darkening operation on the target color according to the color parameters of the target color and the preset color palette generation rule to obtain a first preset number of first adjacent colors and / or a second preset number of second adjacent colors respectively: According to the hue, saturation and brightness of the target color, the corresponding target preset saturation setting rule, target preset brightness setting rule, and target preset hue setting rule in the color palette generation rule are determined respectively, and the saturation, brightness and hue of each of the first adjacent colors and / or each of the second adjacent colors are obtained in turn according to these rules.
9. The device according to claim 8, It is characterized in that At least three preset saturation ranges are preset within the saturation interval of 0 to 100%, and the at least three preset saturation ranges include a maximum preset saturation range, a middle preset saturation range, and a minimum preset saturation range; When the color palette acquisition module sequentially acquires the saturation of each of the first adjacent colors and / or each of the second adjacent colors according to the target preset saturation setting rule, it is used to: If the saturation of the target color is within the maximum preset saturation range, obtaining a first step length for reducing the saturation from the saturation of the target color to a preset minimum saturation value during a lightening operation, and sequentially setting the saturation of each of the first adjacent colors according to the first step length; and / or, during the deepening operation, maintaining the saturation of each of the second adjacent colors equal to a preset maximum saturation value; or If the saturation of the target color is in the middle preset saturation range, obtaining a second step length of reducing the saturation from the saturation of the target color to a preset minimum saturation value during a lightening operation, and sequentially setting the saturation of each of the first adjacent colors according to the second step length; and / or, during a deepening operation, obtaining a third step length in which the saturation increases from the saturation of the target color to a saturation that is a preset maximum saturation value, and sequentially setting the saturation of each of the second adjacent colors according to the third step length; or If the saturation of the target color is within the minimum preset saturation range, maintaining the saturation of each of the first adjacent colors equal to the saturation of the target color during the lightening operation; and / or, during the deepening operation, obtaining a fourth step length in which the saturation increases from the saturation of the target color to a saturation that is a preset maximum saturation value, and sequentially setting the saturation of each of the second adjacent colors according to the fourth step length; or If the saturation of the target color is 0%, the saturation of each of the first adjacent color and / or the second adjacent color is kept equal to 0% during the lightening operation and / or darkening operation.
10. The device according to claim 8, It is characterized in that At least three preset brightness ranges are preset within the brightness interval of 0-100%, and the at least three preset brightness ranges include a maximum preset brightness range, an intermediate preset brightness range, and a minimum preset brightness range; When the color palette acquisition module sequentially acquires the brightness of each of the first adjacent colors and / or each of the second adjacent colors according to the target preset brightness setting rule, it is used to: If the brightness of the target color is within the maximum preset brightness range, maintaining the brightness of each of the first adjacent colors equal to the preset maximum brightness value during the fade operation; and / or, during a deepening operation, obtaining a fifth step length for reducing the brightness from the brightness of the target color to a preset minimum brightness value, and sequentially setting the brightness of each of the second adjacent colors according to the fifth step length; or If the brightness of the target color is in the middle preset brightness range, in a lightening operation, a sixth step length is obtained for increasing the brightness from the brightness of the target color to a preset maximum brightness value, and the brightness of each of the first adjacent colors is sequentially set according to the sixth step length; and / or, in a darkening operation, a seventh step length is obtained for decreasing the brightness from the brightness of the target color to a preset minimum brightness value, and the brightness of each of the second adjacent colors is sequentially set according to the seventh step length; or If the brightness of the target color is within the minimum preset brightness range, in a lightening operation, an eighth step length is obtained in which the brightness increases from the brightness of the target color to a preset maximum brightness value, and the brightness of each of the first adjacent colors is sequentially set according to the eighth step length; and / or, in a darkening operation, the brightness of each of the second adjacent colors is kept equal to the brightness of the target color; or If the brightness of the target color is 0%, then during the lightening operation, a ninth step length is obtained in which the brightness increases from the brightness of the target color to a preset maximum brightness value, and the brightness of each of the first adjacent colors is set in sequence according to the ninth step length; and / or, during the darkening operation, the brightness of each of the second adjacent colors is kept equal to 0%.
11. The device according to claim 8, It is characterized in that When the color palette acquisition module sequentially acquires the hue of each of the first adjacent colors and / or each of the second adjacent colors according to the target preset hue setting rule, it is used to: If the hue of the target color corresponds to a maximum value on the luminance-hue relationship diagram, the hue of each of the first adjacent colors is kept equal to the hue of the target color during the lightening operation; and / or, the hue of each of the second adjacent colors is sequentially increased or decreased by a preset tenth step length during the darkening operation; or If the hue of the target color corresponds to a minimum value on the luminosity-hue relationship diagram, then in a lightening operation, the hue of each of the first adjacent colors is sequentially increased or decreased by a preset tenth step length; and / or, in a darkening operation, the hue of each of the second adjacent colors is kept equal to the hue of the target color; or If the hue of the target color does not correspond to an extreme value on the luminosity-hue relationship diagram, the nearest maximum and / or minimum is determined; during a lightening operation, the hue of each of the first adjacent colors is set to increase or decrease in sequence in the direction of the hue corresponding to the nearest maximum value with a preset tenth step length; and / or, during a darkening operation, the hue of each of the second adjacent colors is set to increase or decrease in sequence in the direction of the hue corresponding to the nearest minimum value with a preset tenth step length.
12. The device according to claim 11, It is characterized in that When the color palette acquisition module sets the hue of each of the first adjacent colors to increase or decrease in sequence in the direction of the hue corresponding to the nearest maximum value with a preset tenth step length during the lightening operation, it is also used to: If the hue of any of the first adjacent colors increases or decreases to the hue corresponding to the nearest maximum value during the lightening operation, the hue of the subsequent first adjacent colors remains at the hue corresponding to the nearest maximum value; and / or When the hue of each of the second adjacent colors is set to increase or decrease in sequence in a preset tenth step toward the direction of the hue corresponding to the nearest minimum value during the deepening operation, it also includes: If the hue of any of the second adjacent colors increases or decreases to the hue corresponding to the nearest minimum value during the darkening operation, the hue of the subsequent second adjacent colors remains at the hue corresponding to the nearest minimum value.
13. An electronic device, It is characterized in that include: at least one processor; and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 6.
14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 6 is implemented.
