Color specification generation method and device, storage medium and electronic equipment

By obtaining the target color data in the design drawing and automatically generating the color gradation plate and color specifications, the problem of the cumbersome process of creating color specifications in the existing technology is solved, improving efficiency and simplifying the designer's workflow.

CN118646829APending Publication Date: 2024-09-13BEIJING CHUANGZUOMEIHAO TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410701051.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-09-13

AI Technical Summary

Technical Problem

The process of creating color specifications in the existing technology is cumbersome and inefficient, requiring designers to manually extract and verify the color data in the design drawings and name them semantically.

Method used

By obtaining the target color data in the design drawing file, the design color matching types are divided according to the color attributes, the color gradation board is generated and the color rules are determined, and the color specifications are automatically generated to avoid the designer's tedious verification and naming operations.

Benefits of technology

It significantly improves the efficiency of color specification generation, simplifies the designer's workflow, and realizes automated color specification generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118646829A
    Figure CN118646829A
Patent Text Reader

Abstract

The invention provides a color specification generation method and apparatus, a storage medium and an electronic device. The method comprises the steps of obtaining target color data of each layer in a design drawing file; the target color data comprises at least one of a filling color and a stroking color; dividing each piece of target color data according to the color attribute of each piece of target color data to obtain a color data set corresponding to each design color matching type of the design drawing file; according to target color data in the color data set corresponding to each design color matching type, generating a color gradation plate corresponding to each design color matching type; and determining a color rule corresponding to each design color matching type, and generating a color specification of each design color matching type according to the color gradation plate and the color rule corresponding to each design color matching type. According to the method provided by the embodiment of the invention, the color specification can be automatically generated without tedious verification and naming operation of a designer, so that the generation efficiency of the color specification is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a color specification generating method, device, storage medium and electronic equipment. Background Art

[0002] In the process of designers drawing design drawings, they usually draw the design drawings based on their visual feelings and experience. After determining the visual effects, they will create the color data in the design drawings into text specifications one by one.

[0003] In the prior art, when creating color specifications, it is usually necessary to use extraction technology to extract the style of the design drawing, and then the designer verifies the extracted information one by one and performs semantic naming. The entire process of creating color specifications is cumbersome, which makes the efficiency of creating color specifications low. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a color specification generation method, device, storage medium and electronic device, which can improve the generation efficiency of color specifications. The specific scheme is as follows:

[0005] A color specification generation method, comprising:

[0006] Acquire target color data of each layer in the design file; the target color data includes at least one of a fill color and a stroke color;

[0007] Divide each of the target color data according to the color attribute of each of the target color data to obtain a color data set corresponding to each design color matching type of the design drawing file;

[0008] Generate a color scale plate corresponding to each of the design color matching types according to the target color data in the color data set corresponding to each of the design color matching types;

[0009] The color rule corresponding to each of the design color matching types is determined, and the color specification of each of the design color matching types is generated according to the color scale plate and the color rule corresponding to each of the design color matching types.

[0010] The above method, optionally, divides each of the target color data according to the color attribute of each of the target color data to obtain a color data set corresponding to each design color matching type of the design drawing file, including:

[0011] Determine the color attribute of each of the target color data; the color attribute includes color brightness and color saturation;

[0012] For each design color matching type of the design drawing file, a color attribute range corresponding to the design color matching type is determined; and each of the target color data having color attributes within the color attribute range is combined into a color data set of the design color matching type.

[0013] In the above method, optionally, determining the color rule corresponding to each of the design color matching types includes:

[0014] Determine a theme type of the design drawing file; the theme type is one of a light theme type and a dark theme type;

[0015] According to the theme type and each of the design color matching types, a preset rule configuration file is queried to obtain the color rule corresponding to each of the design color matching types.

[0016] Optionally, the above method generates a color scale plate corresponding to each design color matching type according to the target color data in the color data set corresponding to each design color matching type, including:

[0017] Determine the usage count of each target color data in the color data set corresponding to each of the design color matching types;

[0018] For each design color matching type, a target number of target color data are selected from the color data set corresponding to the design color matching type in descending order of the number of times each target color data in the color data set corresponding to the design color matching type is used; a color scale plate of the design color matching type is generated based on the selected target color data; and the target number is determined based on the design color matching type.

[0019] In the above method, optionally, generating a color specification for each design color matching type according to a color scale plate and a color rule corresponding to each design color matching type includes:

[0020] In the case where the design color matching type is a brand color type or a grayscale color type, determining the color intervals corresponding to each sub-color matching type of the design color matching type, and generating color specifications for each sub-color matching type of the design color matching type according to the color intervals, color scale plates, and color rules corresponding to each sub-color matching type;

[0021] In the case where the design color matching type is a neutral color type, the color scale plate of the neutral color type is supplemented according to the color rule of the neutral color type to generate the color specification of the neutral color type.

[0022] The above method may optionally further include, after generating the color specification of each design color matching type according to the color scale plate and color rules corresponding to each design color matching type, the method may further include:

[0023] Creating a color style in the design drawing file according to the color specification of each design color matching type;

[0024] An illustration of the color specification of each of the design color matching types is generated in the drawing of the design drawing file.

[0025] A color specification generating device, comprising:

[0026] An acquisition unit, used to acquire each target color data of each layer in the design drawing file; the target color data includes at least one of a fill color and a stroke color;

[0027] A first execution unit, configured to divide each of the target color data according to a color attribute of each of the target color data, and obtain a color data set corresponding to each design color matching type of the design drawing file;

[0028] A generating unit, configured to generate a color scale plate corresponding to each of the design color matching types according to target color data in a color data set corresponding to each of the design color matching types;

[0029] The second execution unit is used to determine the color rule corresponding to each of the design color matching types, and generate the color specification of each of the design color matching types according to the color scale plate and color rule corresponding to each of the design color matching types.

[0030] In the above device, optionally, the first execution unit includes:

[0031] A first determination subunit is used to determine the color attribute of each target color data; the color attribute includes color brightness and color saturation;

[0032] The second determination subunit is used to determine, for each design color matching type of the design drawing file, a color attribute range corresponding to the design color matching type; and to form a color data set of the design color matching type with each target color data having a color attribute within the color attribute range.

[0033] A storage medium includes storage instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the color specification generation method as described above.

[0034] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to perform the color specification generating method as described above.

[0035] Based on the color specification generation method, device, storage medium and electronic device provided by the above-mentioned embodiment of the present invention, each target color data of each layer in the design drawing file can be obtained first; the target color data includes at least one of the fill color and the stroke color; then the target color data is divided according to the color attribute of each target color data to obtain the color data set corresponding to each design color matching type of the design drawing file; then, according to the target color data in the color data set corresponding to each design color matching type, a color scale plate corresponding to each design color matching type is generated; finally, the color rule corresponding to each design color matching type is determined, and the color specification of each design color matching type is generated according to the color scale plate and color rule corresponding to each design color matching type. By applying the method provided by the embodiment of the present invention, the color specification can be automatically generated without the designer having to perform tedious verification and naming operations, which effectively improves the efficiency of color specification generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0037] Figure 1 A method flow chart of a color specification generating method provided by the present invention;

[0038] Figure 2 A flowchart of a process for obtaining a color data set provided by the present invention;

[0039] Figure 3 A flow chart of a process for generating a color scale plate provided by the present invention;

[0040] Figure 4 An example diagram of a color scale plate of a brand color type provided by the present invention;

[0041] Figure 5 An example diagram of the values ​​of a color data set corresponding to a grayscale color type provided by the present invention;

[0042] Figure 6 An example diagram of a grayscale color plate provided by the present invention;

[0043] Figure 7 An example diagram of a color scale plate corresponding to a neutral color type provided by the present invention;

[0044] Figure 8 An example diagram of a color scale plate corresponding to a dangerous color provided by the present invention;

[0045] Fig. 9 An example diagram of a color scale plate corresponding to a warning color provided by the present invention;

[0046] Fig.10 An example diagram of a color scale plate corresponding to a successful color provided by the present invention;

[0047] Fig.11 An example diagram of a toner plate corresponding to an information color provided by the present invention;

[0048] Fig.12 A schematic diagram of the structure of a color specification generating device provided by the present invention;

[0049] Fig.13 The present invention provides a schematic structural diagram of an electronic device. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0052] The embodiment of the present invention provides a method for generating a color specification, which can be applied to electronic devices. The method flow chart of the method is as follows: Figure 1 As shown, specifically including:

[0053] S101: Acquire target color data of each layer in a design file; the target color data includes at least one of a fill color and a stroke color.

[0054] In this embodiment, the design drawing file includes multiple layers, and each target color data of each layer can be obtained, that is, all fill colors and stroke colors in each layer can be obtained.

[0055] S102: Divide each of the target color data according to the color attribute of each of the target color data to obtain a color data set corresponding to each design color matching type of the design drawing file.

[0056] In this embodiment, the color attribute of the target color data may include at least one of saturation and brightness.

[0057] Optionally, the color data of the target color data may be extracted using a preset HSB model.

[0058] In this embodiment, the design color type of the design drawing file may include one or more of a brand color type, a gray color type, a neutral color type, and the like.

[0059] The brand color type may include at least one of the brand primary color, secondary color, and tertiary color; the gray color type may include at least one of the brand text color, background color, and stroke color.

[0060] In an embodiment of the present invention, the target color data are divided according to the color attribute of each target color data to obtain the color data set corresponding to each design color matching type of the design drawing file, such as Figure 2 As shown, including:

[0061] S201: Determine the color attribute of each target color data; the color attribute includes color brightness and color saturation.

[0062] S202: for each design color matching type of the design drawing file, determining a color attribute range corresponding to the design color matching type; and forming a color data set of the design color matching type with each target color data having a color attribute within the color attribute range.

[0063] In this embodiment, the color attribute range corresponding to each design color matching type can be determined, and for each design color matching type, the target color data whose color attributes are within the color attribute range corresponding to the design color matching type can be formed into a color data set corresponding to the design color matching type. That is, the target color data in the color data set corresponding to the design color matching type is within the color attribute range corresponding to the design color matching type.

[0064] Optionally, the color data set corresponding to the brand color type may include target color data with saturation S+brightness B>100. The color data set corresponding to the grayscale color type may include target color data with (S-1)*2+B<100. The color data set corresponding to the neutral color type may include target color data with S=0 and B∈(0,100).

[0065] S103: generating a color scale plate corresponding to each of the design color matching types according to the target color data in the color data set corresponding to each of the design color matching types.

[0066] In this embodiment, for each design color matching type, a target color data may be selected from a color data set corresponding to the design color matching type, and a color scale plate corresponding to the design color matching type may be generated according to the selected target color data.

[0067] In an embodiment of the present invention, the process of generating a color scale plate corresponding to each design color matching type according to the target color data in the color data set corresponding to each design color matching type is as follows: Figure 3 As shown, specifically including:

[0068] S301: Determine the usage count of each target color data in the color data set corresponding to each of the design color matching types.

[0069] S302: For each design color matching type, select a target number of target color data from the color data set corresponding to the design color matching type in descending order of the number of times each target color data in the color data set corresponding to the design color matching type is used; generate a color scale plate for the design color matching type based on the selected target color data; the target number is determined based on the design color matching type.

[0070] In this embodiment, the target numbers of different design color matching types are different. For example, the target number of the brand color type can be 3, that is, 3 target color data can be selected to generate a color scale plate; the target number of the grayscale color type and the neutral color type can be 1.

[0071] In some embodiments, if the color data set corresponding to the design color matching type is empty, the preset color value corresponding to the design color matching type is used to generate the color scale plate corresponding to the design color matching type. For example, if the color data set corresponding to the neutral color type is empty, "#808080" (50% neutral gray) can be used to generate the color scale plate.

[0072] S104: Determine the color rule corresponding to each of the design color matching types, and generate the color specification of each of the design color matching types according to the color scale plate and the color rule corresponding to each of the design color matching types.

[0073] In this embodiment, determining the color rules corresponding to each of the design color matching types includes: determining the theme type of the design drawing file; the theme type is one of a light color theme type and a dark color theme type; according to the theme type and each of the design color matching types, querying a preset rule configuration file to obtain the color rules corresponding to each of the design color matching types.

[0074] Optionally, the process of determining the theme type of the design file includes: starting from the root container of the design file, counting the fill colors of all containers and rectangles with width and height greater than 100px in N layers downward, and based on the HSB model, counting the number of first colors with saturation S less than 20 and brightness B greater than 70, and the number of second colors with saturation S less than 60 and brightness B less than 30; if the number of first colors is greater than the number of second colors, then the design is determined to be a dark theme type, otherwise, the design is determined to be a light theme type. Wherein, N can be an integer such as 1, 2, or 3.

[0075] In this embodiment, the color specification of each design color matching type is generated according to the color scale plate and color rules corresponding to each design color matching type, including:

[0076] In the case where the design color matching type is a brand color type, a gray color type or a functional color type, determining the color intervals corresponding to each sub-color matching type of the design color matching type, and generating color specifications for each sub-color matching type of the design color matching type according to the color intervals, color scale plates and color rules corresponding to each sub-color matching type;

[0077] In the case where the design color matching type is a neutral color type, the color scale plate of the neutral color type is supplemented according to the color rule of the neutral color type to generate the color specification of the neutral color type.

[0078] Optionally, if the design color scheme is of the brand color type, the color ranges corresponding to the brand primary color, the secondary color, and the tertiary color may be determined.

[0079] By applying the method provided in the embodiment of the present invention, color specifications can be automatically generated without the need for designers to perform tedious verification and naming operations, thereby effectively improving the efficiency of generating color specifications.

[0080] In order to clearly introduce the process of generating color specifications, an example is given below:

[0081] First, the process of generating the color specifications for brand colors is as follows:

[0082] Step a1: Based on the HSB model, extract all target color data with S+B>100 in the design drawing, obtain the color data set corresponding to the brand color type, and extract the color data set into a color scale plate based on the Tailwind CSS algorithm. The generated color scale plate is as follows: Figure 4 shown.

[0083] Step a2, retaining the target color data that can be located in the range of 200 to 800 in the color data set, and discarding the target color data located in the range of 50, 100, 900, and 950.

[0084] Step a3, merging the target color data located in the range of 200 to 800 according to the color scale plate, and retaining only the color with the most usage times for the colors matched to the same color scale plate.

[0085] Step a4, sort the merged colors by the number of times they are used, take the three colors with the highest number of times, which are the brand's primary color, secondary color, and secondary secondary color, and generate three sets of color scale palettes based on the Tailwind CSS algorithm.

[0086] Step a5, based on the generated color scale palette of the brand primary color, auxiliary color, and secondary auxiliary color, and the color rules corresponding to the brand color type, generate the colors of each interactive state of the brand color type, including hover state, active state, disabled state, subtle state, and strong state. The specific algorithm is as follows (the algorithm takes the brand primary color as an example, and the colors of each interactive state of the auxiliary color and the secondary auxiliary color are generated in the same way as the colors of each interactive state of the brand primary color).

[0087] When the theme type is a light color theme type, you can use the color scale palette based on the brand's primary color and the color rules of the light color theme type, including:

[0088] If the brand's main color is positioned between 200 and 300, the hover state is the color of the range + 1 (one range to the right) on the color scale board, and the active state is the color of the range + 2 (two ranges to the right) on the color scale board. For example, if the brand's main color is 300, the hover state of the brand's main color is 400 on the same color scale board, and the active state of the brand's main color is 500 on the same color scale board.

[0089] If the brand's main color is positioned between 400 and 800, the hover state is the color of the range -1 (one range to the left) on the color scale board, and the active state is the color of the range +1 (one range to the right) on the color scale board; for example: if the brand's main color is 500, the hover state of the brand's main color is 400 on the same color scale board, and the active state of the brand's main color is 600 on the same color scale board.

[0090] Optionally, the disable state is the color value of the brand primary color plus alpha=0.5, that is, the color of the brand primary color with 50% transparency is used as the color of the disable state; for example, if the brand primary color is "#3B82F6", the color of Primary-disable is "#3B82F6" with a=0.5.

[0091] Optionally, the subtle state is the color of the interval -4 of the brand main color on the color scale, with a minimum of 100. For example, if the brand main color is 300, -4 represents a shift to the left by 4 intervals, and the interval on the left side of the color scale is insufficient to meet this condition, then the color is moved to the minimum interval of 100 as the subtle state color of the brand main color.

[0092] The strong state is the color of the brand main color interval + 3 on the color scale, with a maximum of 900. For example, if the brand main color is 700, +3 means moving 3 intervals to the right. However, the right interval of the color scale is insufficient to meet this condition, so the color moves to the maximum interval of 900 as the strong color of the brand main color.

[0093] When the theme type is a dark theme type, you can use the color scale palette based on the brand's primary color and the color rules of the dark theme type, including:

[0094] If the brand's main color is positioned between 700 and 800, the hover state is -1 (one interval to the left), and the active state is -2 (two intervals to the left);

[0095] If the brand's main color is located between 200 and 600, the hover state is +1 (one interval to the right), and the active state is -1 (one interval to the left);

[0096] Optionally, the disable state is the color value of the brand's primary color plus alpha = 0.5; the subtle state is the brand's primary color + 4 (shifted 4 intervals to the right), with a maximum of 900; the strong state is the brand's primary color - 3 (shifted 3 intervals to the left), with a minimum of 100.

[0097] At this point, we have a complete color specification for the three brand colors, including colors for multiple interactive states.

[0098] Second, generate a color specification of a grayscale color type in the color specification. In this embodiment, the grayscale color type includes at least one sub-color type of the text color Text, the background color Background, and the stroke color Stroke. The generation process is as follows:

[0099] Step b1: The text, background, and stroke colors can be generated based on the same set of grayscale levels. Based on the HSB model, the target color data that satisfies (S-1)*2+B<100 can be extracted from the design drawing as the color data set corresponding to the grayscale color type. Figure 5 , the color data set corresponding to the grayscale color type may include Figure 5 Target color data within the range to the left of the middle green line.

[0100] Step b2, grouping each target color data in the color data set corresponding to the grayscale color type to obtain group 1, group 2 and group 3; wherein group 1 includes all fill colors applied on the text layer, which can be used as text color; group 2 includes all fill colors applied on the container and rectangle layers, which can be used as background color; group 3 includes all stroke colors applied on the line and path layers, which can be used as stroke color;

[0101] Step b3, select the most frequently used color from the color data set corresponding to the grayscale type, and generate a grayscale color palette, such as Figure 6 The following is an example of a grayscale palette. The text, background, and stroke colors below will all be taken from this grayscale palette.

[0102] Step b4, generate color scale plates for the colors in the three groups respectively, determine their positioning intervals, and generate colors according to the color rules corresponding to the grayscale color type and the positioning intervals.

[0103] When the theme type is a light color type, the process of generating colors based on color rules and positioning intervals includes:

[0104] For text color Text, if there are more target color data located in the range of 50 to 600, the colors in the range of 900, 600, 400, and 300 are taken from the grayscale color palette as the text color styles: Text-title, Text-body, Text-body-subtle, and Text-caption; if there are more target color data located in the range of 700 to 950, the colors in the range of 950, 700, 500, and 400 are taken from the grayscale color palette as the text color styles: Text-title, Text-body, Text-body-subtle, and Text-caption;

[0105] For the background color Background, select the colors in the 50, 100, and 200 intervals from the grayscale palette as the background color styles: Background-1, Background-2, and Background-3;

[0106] For the stroke color Stroke, if there are more target color data located in the interval of 50-100, the colors in the intervals of 50, 100, and 200 are taken from the grayscale color palette as the stroke color styles: Border-1, Border-2, and Border-3; if there are more target color data located in the interval of 200-800, then according to the interval where the largest number of colors are located, the colors of the positioning interval -1 (left shifted by 1 interval), the positioning interval, and the positioning interval +1 (right shifted by one interval) are taken from the grayscale color palette as the stroke color styles Border-1, Border-2, and Border-3; if there are more target color data located in the interval of 900-950, then according to the interval where the largest number of colors are located, the colors of the positioning interval -4, positioning interval -2, and positioning interval are taken from the grayscale color palette as the stroke color styles: Border-1, Border-2, and Border-3.

[0107] When the theme type is a dark type, the process of generating colors based on color rules and positioning intervals includes:

[0108] For text color Text, if there are more target color data located in the range of 50 to 300, then the colors in the range of 50, 300, 500, and 600 are taken from the grayscale color palette as the text color styles: Text-title, Text-body, Text-body-subtle, and Text-caption; if there are more target color data located in the range of 400 to 950, then the colors in the range of 100, 400, 600, and 700 are taken from the grayscale color palette as the text color styles: Text-title, Text-body, Text-body-subtle, and Text-caption;

[0109] For the background color Background, if you take the colors in the 950, 900, 800 range from the grayscale palette as the background color style: Background-1, Background-2, Background-3;

[0110] For the stroke color Stroke, if there are more target color data located in the interval of 50-100, then according to the interval where the largest number of colors are located, the colors of the positioning interval, positioning interval + 2, and positioning interval + 4 are taken from the grayscale color palette as the stroke color styles: Border-1, Border-2, Border-3; if there are more target color data located in the interval of 200-800, then according to the interval where the largest number of colors are located, the colors of the positioning interval + 1, positioning interval, and positioning interval - 1 are taken from the grayscale color palette as the stroke color styles: Border-1, Border-2, Border-3; if there are more target color data located in the interval of 900-950, then the colors of the 950, 900, and 800 intervals are taken from the grayscale color palette as the stroke color styles: Border-1, Border-2, Border-3.

[0111] At this point, we have obtained complete color specifications for text color, background color, and stroke color.

[0112] Third, generate a color specification of a neutral color type. Generating a color specification of a neutral color type may include the following process:

[0113] Step c1, extract all colors with S=0 and B∈(0,100) (i.e. pure gray without any saturation) from the design drawing, select the color with the most usage, and generate a color scale plate corresponding to the neutral color type. The generated color scale plate is as follows: Figure 7 Optionally, if there is no qualified color in the design drawing, use "#808080" (50% neutral gray) to generate a color scale plate.

[0114] Step c2, based on the generated color scale plate, add "White#FFFFFF" (pure white) and "Black#000000" (pure black).

[0115] At this point, a complete neutral color specification is generated.

[0116] In some embodiments, after generating color specifications of design color types such as brand color type, gray color type, neutral color type, etc., color specifications of functional color types of design drawings can also be generated. Functional color types can include at least one sub-color type such as success color Success, information color Infomation, warning color Warning, and danger color Danger. Specifically, the color value of the target sub-color type of the functional color type can be determined first. The target sub-color type can be any one of the success color, information color, warning color, and danger color, for example, it can be a danger color.

[0117] Optionally, an HSB value can be randomly generated from the following range: hue H∈[0, 10], S∈[85, 95], B∈[96, 100]; the generated HSB value is used as the color value of the dangerous color. Then, according to the color value of the dangerous color and the OKLAB algorithm, the success color, information color and warning color are generated according to the preset rules. Among them, the hue of the success color = the hue of the dangerous color + the first preset value, the hue of the warning color = the hue of the dangerous color + the second preset value, and the hue of the information color = the hue of the dangerous color + the third preset value. The first preset value can be 120, the second preset value can be 25, and the third preset value can be 210. The brightness and saturation of the dangerous color, the information color, the warning color and the success color can be the same or different.

[0118] After obtaining the color values ​​of the danger color, the information color, the success color, and the warning color, the color scale plates corresponding to the danger color, the information color, the warning color, and the success color are generated according to the color values ​​of the danger color, the information color, and the warning color. Figure 8 As shown in the figure, it is an example of the color scale plate corresponding to the dangerous color; Fig. 9 As shown in the figure, it is an example of the color scale plate corresponding to the warning color; Fig.10 As shown in the figure, it is an example of the color scale plate corresponding to the successful color; Fig.11 The following is an example of a color scale palette corresponding to information colors.

[0119] Then, query the preset configuration file to obtain the color rules corresponding to each sub-color type of the functional color type, generate the colors of each interactive state of each sub-color type according to the color rules and color scale plate corresponding to each sub-color type of the functional color type, and obtain the color specification of the functional color type.

[0120] Finally, the brand color, text color, background color, stroke color, functional color, and neutral color generated above are created as color styles respectively, and the corresponding specification diagram is generated in the canvas to complete the entire color specification generation function.

[0121] In some embodiments, after generating the color specification of each design color matching type according to the color scale plate and color rules corresponding to each design color matching type, the method further includes:

[0122] Creating a color style in the design drawing file according to the color specification of each design color matching type;

[0123] An illustration of the color specification of each of the design color matching types is generated in the drawing of the design drawing file.

[0124] and Figure 1Corresponding to the method described above, the embodiment of the present invention further provides a color specification generating device for Figure 1 The specific implementation of the method is shown in the following diagram: Fig.12 As shown, including:

[0125] An acquisition unit 1201 is used to acquire target color data of each layer in a design file; the target color data includes at least one of a fill color and a stroke color;

[0126] The first execution unit 1202 is used to divide each of the target color data according to the color attribute of each of the target color data to obtain a color data set corresponding to each design color matching type of the design drawing file;

[0127] A generating unit 1203 is used to generate a color scale plate corresponding to each of the design color matching types according to the target color data in the color data set corresponding to each of the design color matching types;

[0128] The second execution unit 1204 is used to determine the color rule corresponding to each of the design color matching types, and generate the color specification of each of the design color matching types according to the color scale plate and the color rule corresponding to each of the design color matching types.

[0129] In an embodiment provided by the present invention, based on the above solution, optionally, the first execution unit includes:

[0130] A first determination subunit is used to determine the color attribute of each target color data; the color attribute includes color brightness and color saturation;

[0131] The second determination subunit is used to determine, for each design color matching type of the design drawing file, a color attribute range corresponding to the design color matching type; and to form a color data set of the design color matching type with each target color data having a color attribute within the color attribute range.

[0132] In an embodiment provided by the present invention, based on the above solution, optionally, determining the color rule corresponding to each of the design color matching types includes:

[0133] Determine a theme type of the design drawing file; the theme type is one of a light theme type and a dark theme type;

[0134] According to the theme type and each of the design color matching types, a preset rule configuration file is queried to obtain the color rule corresponding to each of the design color matching types.

[0135] In an embodiment provided by the present invention, based on the above solution, optionally, generating a color scale plate corresponding to each design color matching type according to the target color data in the color data set corresponding to each design color matching type includes:

[0136] Determine the usage count of each target color data in the color data set corresponding to each of the design color matching types;

[0137] For each design color matching type, a target number of target color data are selected from the color data set corresponding to the design color matching type in descending order of the number of times each target color data in the color data set corresponding to the design color matching type is used; a color scale plate of the design color matching type is generated based on the selected target color data; and the target number is determined based on the design color matching type.

[0138] In an embodiment provided by the present invention, based on the above solution, optionally, generating a color specification of each design color matching type according to a color scale plate and a color rule corresponding to each design color matching type includes:

[0139] In the case where the design color matching type is a brand color type or a grayscale color type, determining the color intervals corresponding to each sub-color matching type of the design color matching type, and generating color specifications for each sub-color matching type of the design color matching type according to the color intervals, color scale plates, and color rules corresponding to each sub-color matching type;

[0140] In the case where the design color matching type is a neutral color type, the color scale plate of the neutral color type is supplemented according to the color rule of the neutral color type to generate the color specification of the neutral color type.

[0141] In an embodiment provided by the present invention, based on the above solution, optionally, after generating the color specification of each design color matching type according to the color scale plate and color rule corresponding to each design color matching type, the method further includes:

[0142] Creating a color style in the design drawing file according to the color specification of each design color matching type;

[0143] An illustration of the color specification of each of the design color matching types is generated in the drawing of the design drawing file.

[0144] The specific principles and execution processes of each unit and module in the color specification generating device disclosed in the above embodiment of the present invention are the same as the color specification generating method disclosed in the above embodiment of the present invention. Please refer to the corresponding parts of the color specification generating method provided in the above embodiment of the present invention, and will not be repeated here.

[0145] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned color specification generating method.

[0146] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Fig.13 As shown, it specifically includes a memory 1301 and one or more instructions 1302, wherein the one or more instructions 1302 are stored in the memory 1301 and are configured to be executed by one or more processors 1303 to perform the following operations:

[0147] Acquire target color data of each layer in the design file; the target color data includes at least one of a fill color and a stroke color;

[0148] Divide each of the target color data according to the color attribute of each of the target color data to obtain a color data set corresponding to each design color matching type of the design drawing file;

[0149] Generate a color scale plate corresponding to each of the design color matching types according to the target color data in the color data set corresponding to each of the design color matching types;

[0150] The color rule corresponding to each of the design color matching types is determined, and the color specification of each of the design color matching types is generated according to the color scale plate and the color rule corresponding to each of the design color matching types.

[0151] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0152] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.

[0153] For the convenience of description, the above device is described as being divided into various units according to their functions. Of course, when implementing the present invention, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0154] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention or certain parts of the embodiments.

[0155] The above is a detailed introduction to a color specification generation method provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A color specification generation method, It is characterized in that include: Get each target color data of each layer in the design file; The target color data includes at least one of a fill color and a stroke color; Divide each of the target color data according to the color attribute of each of the target color data to obtain a color data set corresponding to each design color matching type of the design drawing file; Generate a color scale plate corresponding to each of the design color matching types according to the target color data in the color data set corresponding to each of the design color matching types; The color rule corresponding to each of the design color matching types is determined, and the color specification of each of the design color matching types is generated according to the color scale plate and the color rule corresponding to each of the design color matching types.

2. The method according to claim 1, It is characterized in that The step of dividing each target color data according to the color attribute of each target color data to obtain a color data set corresponding to each design color matching type of the design drawing file includes: Determine the color attribute of each of the target color data; the color attribute includes color brightness and color saturation; For each design color matching type of the design drawing file, a color attribute range corresponding to the design color matching type is determined; and each of the target color data having color attributes within the color attribute range is combined into a color data set of the design color matching type.

3. The method according to claim 1, It is characterized in that Determining the color rule corresponding to each of the design color matching types includes: Determine a theme type of the design drawing file; the theme type is one of a light theme type and a dark theme type; According to the theme type and each of the design color matching types, a preset rule configuration file is queried to obtain the color rule corresponding to each of the design color matching types.

4. The method according to claim 1, It is characterized in that The step of generating a color scale plate corresponding to each design color matching type according to the target color data in the color data set corresponding to each design color matching type comprises: Determine the usage count of each target color data in the color data set corresponding to each of the design color matching types; For each design color matching type, a target number of target color data are selected from the color data set corresponding to the design color matching type in descending order of the number of times each target color data in the color data set corresponding to the design color matching type is used; a color scale plate of the design color matching type is generated based on the selected target color data; and the target number is determined based on the design color matching type.

5. The method according to claim 4, It is characterized in that Generating a color specification for each design color matching type according to the color scale plate and color rules corresponding to each design color matching type includes: In the case where the design color matching type is a brand color type or a grayscale color type, determining the color intervals corresponding to each sub-color matching type of the design color matching type, and generating color specifications for each sub-color matching type of the design color matching type according to the color intervals, color scale plates, and color rules corresponding to each sub-color matching type; In the case where the design color matching type is a neutral color type, the color scale plate of the neutral color type is supplemented according to the color rule of the neutral color type to generate the color specification of the neutral color type.

6. The method according to claim 1, It is characterized in that After generating the color specification of each design color matching type according to the color scale plate and color rules corresponding to each design color matching type, the method further includes: Creating a color style in the design drawing file according to the color specification of each design color matching type; An illustration of the color specification of each of the design color matching types is generated in the drawing of the design drawing file.

7. A color specification generating device, It is characterized in that include: An acquisition unit, used for acquiring each target color data of each layer in the design drawing file; The target color data includes at least one of a fill color and a stroke color; A first execution unit, configured to divide each of the target color data according to a color attribute of each of the target color data, and obtain a color data set corresponding to each design color matching type of the design drawing file; A generating unit, configured to generate a color scale plate corresponding to each of the design color matching types according to target color data in a color data set corresponding to each of the design color matching types; The second execution unit is used to determine the color rule corresponding to each of the design color matching types, and generate the color specification of each of the design color matching types according to the color scale plate and color rule corresponding to each of the design color matching types.

8. The device according to claim 7, It is characterized in that The first execution unit includes: A first determination subunit is used to determine the color attribute of each target color data; the color attribute includes color brightness and color saturation; The second determination subunit is used to determine, for each design color matching type of the design drawing file, a color attribute range corresponding to the design color matching type; and to form a color data set of the design color matching type with each target color data having a color attribute within the color attribute range.

9. A storage medium, It is characterized in that The storage medium includes storage instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the color specification generating method according to any one of claims 1 to 6.

10. An electronic device, It is characterized in that The system comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to execute the color specification generating method according to any one of claims 1 to 6 by one or more processors.

Citation Information

Cited By

  • Color style configuration method and apparatus, device, and storage medium

    WO2026076725A1