A method, device, equipment and storage medium for automatic page color matching
By establishing a color system template library and background color learning model, the target model is obtained, which solves the problem of page color matching experience dependence and low accuracy in the existing technology, and achieves fast and accurate component color determination.
Patent Information
- Application Number
- CN202111589404.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2041-12-23
AI Technical Summary
In the prior art, page color matching requires operators to have rich experience, long color matching time, low accuracy, and poor reusability.
Establish a color system template library and an initial background color learning model, obtain a trained target background color learning model through training, and combine the color system template library to determine the component colors of the page to be matched.
It enables developers who do not need front-end color experience to quickly complete the front-end visual page development, and the component color matching is more accurate, providing a basis for reuse.
Smart Images

Figure CN114253539B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of page color matching, and in particular to a method, device, equipment and storage medium for automatic page color matching. Background Art
[0002] In today's visual display field, the style and color matching of components are related to the display effect of the page. Different backgrounds and component styles need to be configured in different scenarios, while also ensuring the beauty and coordination of the display.
[0003] In existing technologies, these tasks often require professional artists and front-end developers to design according to their own preferences and manually select colors to match the page colors.
[0004] Manual color matching of pages requires operators to have rich color matching experience, and the color matching process is long and has low accuracy. The final output is not real-time and reusable. Summary of the Invention
[0005] In view of this, it is necessary to provide a page automatic color matching method, device, equipment and storage medium to solve the problems in the existing technology that the operator needs to have rich color matching experience, the color matching time is long, the color matching accuracy is low and the reusability is poor.
[0006] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:
[0007] In a first aspect, the present invention provides a method for automatically matching page colors, comprising:
[0008] Establish a color template library based on different color schemes;
[0009] Establish an initial background color learning model;
[0010] Based on the page color matching examples and the color template library, the initial background color learning model is trained to obtain a fully trained target background color learning model;
[0011] Determine the component colors of the page to be matched based on the fully trained target background color learning model and color template library.
[0012] Preferably, the initial background color learning model is:
[0013] Y=K1*f(X1)...+K n *f(X n );
[0014] Among them, Y represents the component color, K1...K n represents the learning coefficient, X1...X nRepresents the background color around the component, and f represents the nesting algorithm.
[0015] Preferably, the initial background color learning model is trained based on the page color matching example and the color template library to obtain a fully trained target background color learning model, including:
[0016] Get the historical data of page color matching instances, including the page background color and page component colors;
[0017] The page background color and the page component color are input into the initial background color learning model to determine the learning coefficient;
[0018] According to the historical data of page color matching instances and the learning coefficient, the initial background color learning model is trained to obtain a fully trained target background color learning model.
[0019] Preferably, the component colors of the page to be color matched are determined based on a well-trained target background color learning model and a color template library, including:
[0020] After the background color of the page to be color-matched is input into the fully trained target background color learning model, the fully trained target background color learning model searches for the corresponding component color according to the color template library. If the corresponding component color exists in the color template library, the corresponding component color is output.
[0021] Preferably, if the color template library exists after the corresponding component color, it also includes:
[0022] Determine whether the corresponding component color in the color template library meets the preset standard. If it meets the standard, output the corresponding component color in the color template library;
[0023] If it does not meet the standards, the corresponding component color is configured using the second preset method.
[0024] Preferably, configuring the corresponding component color by a second preset method includes:
[0025] Then, based on the corresponding component color output by the trained target background color learning model, a similar color is selected as the corresponding component color;
[0026] The similar colors and the background color of the page to be color-matched are input into a fully trained target background color learning model, a learning coefficient is calculated, and the learning coefficient is added to the fully trained target background color learning model.
[0027] Preferably, determining the component colors of the page to be color matched based on a well-trained target background color learning model and a color template library further includes:
[0028] After the background color of the page to be color-matched is input into the trained target background color learning model, the trained target background color learning model searches for the corresponding component color according to the color template library. If the corresponding component color does not exist in the color template library, the corresponding component color is configured using the first preset method;
[0029] The corresponding component color configured in a preset manner and the background color of the page to be colored are input into a fully trained target background color learning model, a learning coefficient is calculated, and the learning coefficient is added to the fully trained target background color learning model.
[0030] In a second aspect, the present invention further provides a device for automatically matching page colors, comprising:
[0031] The color system module is used to build a color system template library based on different color systems;
[0032] Modeling module, used to establish the initial background color learning model;
[0033] The optimization module is used to optimize the initial background color learning model based on the page color matching examples and the color template library to obtain a fully trained target background color learning model;
[0034] The color matching module is used to determine the component colors of the page to be matched based on the trained target background color learning model and the color template library.
[0035] In a third aspect, the present invention further provides an electronic device comprising a memory and a processor, wherein:
[0036] Memory, used to store programs;
[0037] The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the page automatic color matching method in any of the above implementations.
[0038] In a fourth aspect, the present invention further provides a computer-readable storage medium for storing computer-readable programs or instructions. When the programs or instructions are executed by a processor, the steps in the page automatic color matching method in any of the above-mentioned implementation methods can be implemented.
[0039] The beneficial effects of adopting the above-mentioned embodiments are: the automatic page color matching method, device, equipment and storage medium provided by the present invention establish a color template library, and then establish a background color learning model, and train the background color learning model to obtain a fully trained target background color learning model. By training the fully trained target background color learning model and the color template library, the component colors of the page to be matched are determined, allowing developers without front-end color experience to quickly complete the development of the front-end visualization page, and the color matching of the component matches the background color more accurately, and the selection of component colors is quantified, leaving a reuse basis for future development. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic flow chart of an embodiment of the automatic page color matching method provided by the present invention;
[0041] Figure 2 A schematic diagram of a process flow of an embodiment of the initial background color learning model training provided by the present invention;
[0042] Figure 3 A schematic structural diagram of an embodiment of the automatic page color matching device provided by the present invention;
[0043] Figure 4 A schematic diagram of the structure of an electronic device for automatic page color matching provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, and are not used to limit the scope of the present invention.
[0045] In the description of the present application, “plurality” means two or more, unless otherwise clearly defined.
[0046] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute a separate or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0047] The present invention provides a method, apparatus, device and storage medium for automatic page color matching, which are described below respectively.
[0048] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of the automatic page color matching method provided by the present invention. A specific embodiment of the present invention discloses an automatic page color matching method, including:
[0049] S101. Establish a color system template library based on different color systems;
[0050] S102, establishing an initial background color learning model;
[0051] S103, training the initial background color learning model based on the page color matching example and the color template library to obtain a fully trained target background color learning model;
[0052] S104: Determine the component colors of the page to be color matched based on the fully trained target background color learning model and the color template library.
[0053] In a specific embodiment of the present invention, step S101 establishes multiple sets of color templates to expand the color coverage, divide the standard colors into color systems, and formulate 96 color ranges, each of which has a corresponding template.
[0054] In a specific embodiment of the present invention, in step S102, the present invention realizes automatic color matching of the page through a neural network model. The initial background color learning model established is the initial neural network model. The initial background color learning model still needs to be trained to realize automatic color matching of the page.
[0055] In a specific embodiment of the present invention, the page color matching instance in step S103 is the page color matching history data, and the background color learning model matches multiple colors in the color template library, selects the matching color as the output, and finally obtains a fully trained target background color learning model through a large amount of training.
[0056] In a specific embodiment of the present invention, after the background color of the page to be color-matched is determined in step S104, a matching color is selected and outputted as the component color of the page to be color-matched based on a well-trained target background color learning model and a color template library.
[0057] Compared with the existing technology, the automatic page color matching method provided by this embodiment establishes a color template library, then establishes a background color learning model, and trains the background color learning model to obtain a fully trained target background color learning model. By training the fully trained target background color learning model and the color template library, the component colors of the page to be matched are determined, allowing developers without front-end color experience to quickly complete the development of the front-end visualization page, and more accurately match the component color with the background color, quantifying the selection of component colors, leaving a reuse basis for future development.
[0058] In some embodiments of the present invention, the initial background color learning model is:
[0059] Y=K1*f(X1)...+K n *f(X n );
[0060] Among them, Y represents the component color, K1...K n represents the learning coefficient, X1...X n Represents the background color around the component, and f represents the nesting algorithm.
[0061] In the above embodiment, the formula is an initial background color learning model. The model may have multiple surrounding background colors, but each background color corresponds to a learning coefficient, while there is only one component color.
[0062] It is understandable that the nested algorithm can set multiple algorithms, and the background color learning model can always learn new color schemes, which has good reusability.
[0063] See also Figure 2 , Figure 2 This is a flow chart of an embodiment of training an initial background color learning model provided by the present invention. In some embodiments of the present invention, the initial background color learning model is trained based on page color matching examples and a color template library to obtain a fully trained target background color learning model, including:
[0064] S201, obtaining page color matching instance historical data, the page color matching instance historical data including page background color and page component color;
[0065] S202: Input the page background color and the page component color into the initial background color learning model to determine the learning coefficient;
[0066] S203 : Training the initial background color learning model according to the page color matching instance historical data and the learning coefficient to obtain a fully trained target background color learning model.
[0067] In step S201, the page color matching instance historical data is the data of previous manual page color matching. Professionals select matching page component colors based on the background color of the page, and train the initial background color learning model based on the page color matching instance historical data.
[0068] In step S202, according to the formula of the initial background color learning model, by inputting the page background color and the page component color, a learning coefficient can be calculated. Only after the learning coefficient is determined can the component color be determined according to the background color.
[0069] In step S203, after the learning coefficient is determined, the page background color is used as the input of the initial background color learning model, and the page component color is used as the output. The initial background color learning model is trained to finally obtain a fully trained target background color learning model.
[0070] In the above embodiment, the learning coefficient in the initial background color model is determined by the historical data of the page color matching instance, and then based on the historical data of the page color matching instance, the page background color is used as the input of the initial background color learning model, and the page component color is used as the output, and the initial background color model is trained to finally obtain a fully trained target background color learning model.
[0071] In some embodiments of the present invention, determining the component colors of a page to be color matched based on a well-trained target background color learning model and a color template library includes:
[0072] After the background color of the page to be color-matched is input into the fully trained target background color learning model, the fully trained target background color learning model searches for the corresponding component color according to the color template library. If the corresponding component color exists in the color template library, the corresponding component color is output.
[0073] In the above embodiment, the background color of the page to be matched is first determined, and by training a complete target background color learning model, the color of the appropriate corresponding component is searched from the color template library. If a matching color of the corresponding component can be found in the color template library, the corresponding component color is directly output as output.
[0074] In some embodiments of the present invention, if the color system template library exists after the corresponding component color, it also includes:
[0075] Determine whether the corresponding component color in the color template library meets the preset standard. If it meets the standard, output the corresponding component color in the color template library;
[0076] If it does not meet the standards, the corresponding component color is configured using the second preset method.
[0077] In the above embodiment, after the fully trained target background color learning model determines the corresponding component color based on the background color to be matched, it still needs to be manually inspected, and the preset standards are judged by professional technicians. When the calculation results obtained by the background color learning model do not meet the requirements, the color is matched using the second preset method, that is, professional technicians select matching colors from adjacent similar colors within a 90-degree angle on the color wheel based on the color output by the background color learning model, and fine-tune the color output by the background color learning model to obtain a more ideal color matching effect.
[0078] In some embodiments of the present invention, configuring the corresponding component color by the second preset method includes:
[0079] Then, based on the corresponding component color output by the trained target background color learning model, a similar color is selected as the corresponding component color;
[0080] The similar colors and the background color of the page to be color-matched are input into a fully trained target background color learning model, a learning coefficient is calculated, and the learning coefficient is added to the fully trained target background color learning model.
[0081] In the above embodiment, similar colors are colors that are adjacent within a 90-degree angle on the color wheel. After color matching is performed in the second preset method, the corresponding background color and component color need to be input into the trained target background color learning model for further learning. When the background color is encountered again, the background color learning model will be able to match colors.
[0082] It is understandable that a fully trained target background color learning model can continue to learn and improve its own color matching ability during the color matching process, and has good reusability.
[0083] In some embodiments of the present invention, determining the component colors of a page to be color matched based on a fully trained target background color learning model and a color template library further includes:
[0084] After the background color of the page to be color-matched is input into the trained target background color learning model, the trained target background color learning model searches for the corresponding component color according to the color template library. If the corresponding component color does not exist in the color template library, the corresponding component color is configured using the first preset method;
[0085] The corresponding component color configured in a preset manner and the background color of the page to be colored are input into a fully trained target background color learning model, a learning coefficient is calculated, and the learning coefficient is added to the fully trained target background color learning model.
[0086] In the above embodiment, since the color types of the color template library are limited, when the fully trained target background color learning model cannot find the corresponding component color from the color template library, it is necessary to match the color through the first preset method. The first preset method is manual color matching, in which professional technicians configure the component color of the page to be matched according to the background color of the page to be matched.
[0087] It is understandable that after professional technicians complete the color matching, the corresponding background color and component color are input into the well-trained target background color learning model for further learning. When the background color is encountered again, the background color learning model will be able to match the color.
[0088] In order to better implement the automatic page color matching method in the embodiment of the present invention, based on the automatic page color matching method, please refer to Figure 3 , Figure 3 This is a schematic diagram of the structure of an embodiment of an automatic page color matching device provided by the present invention. The embodiment of the present invention provides an automatic page color matching device 300, comprising:
[0089] The color system module 301 is used to establish a color system template library based on different color systems;
[0090] Modeling module 302, for establishing an initial background color learning model;
[0091] Optimization module 303, used to optimize the initial background color learning model based on the page color matching example and the color template library to obtain a fully trained target background color learning model;
[0092] The color matching module 304 is used to determine the component colors of the page to be matched based on the trained target background color learning model and the color template library.
[0093] It should be noted here that the device 300 provided in the above embodiment can implement the technical solutions described in the above method embodiments. The specific implementation principles of the above modules or units can be found in the corresponding contents in the above method embodiments, which will not be repeated here.
[0094] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device for automatic page color matching provided by an embodiment of the present invention. Based on the aforementioned automatic page color matching method, the present invention also provides an automatic page color matching device. The automatic page color matching device can be a computing device such as a mobile terminal, desktop computer, notebook, PDA, or server. The automatic page color matching device includes a processor 410, a memory 420, and a display 430. Figure 4 Only some of the components of the electronic device are shown, but it should be understood that it is not required to implement all of the shown components, and more or fewer components may be implemented instead.
[0095] In some embodiments, the memory 420 can be an internal storage unit of the automatic page color matching device, such as a hard disk or memory of the automatic page color matching device. In other embodiments, the memory 420 can also be an external storage device of the automatic page color matching device, such as a plug-in hard disk equipped on the automatic page color matching device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Furthermore, the memory 420 can also include both an internal storage unit of the automatic page color matching device and an external storage device. The memory 420 is used to store application software and various types of data installed in the automatic page color matching device, such as program code for installing the automatic page color matching device. The memory 420 can also be used to temporarily store data that has been output or is about to be output. In one embodiment, the memory 420 stores an automatic page color matching program 440, which can be executed by the processor 410, thereby implementing the automatic page color matching method of each embodiment of the present application.
[0096] In some embodiments, the processor 410 may be a central processing unit (CPU), a microprocessor, or other data processing chip, configured to execute program codes stored in the memory 420 or process data, such as executing a page automatic color matching method.
[0097] In some embodiments, the display 430 can be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 430 is used to display information about the automatic page color matching device and to display a visual user interface. The components 410-430 of the automatic page color matching device communicate with each other via a system bus.
[0098] In one embodiment, when the processor 410 executes the automatic page color matching program 440 in the memory 420 , the steps in the above automatic page color matching method are implemented.
[0099] This embodiment further provides a computer-readable storage medium storing an automatic page color matching program. When the automatic page color matching program is executed by a processor, the following steps are implemented:
[0100] Establish a color template library based on different color schemes;
[0101] Establish an initial background color learning model;
[0102] Based on the page color matching examples and the color template library, the initial background color learning model is trained to obtain a fully trained target background color learning model;
[0103] Determine the component colors of the page to be matched based on the fully trained target background color learning model and color template library.
[0104] In summary, the present embodiment provides a method, apparatus, device and storage medium for automatic page color matching, which establishes a color template library, then establishes a background color learning model, trains the background color learning model to obtain a fully trained target background color learning model, and determines the component colors of the page to be matched by training the fully trained target background color learning model and the color template library, allowing developers without front-end color experience to quickly complete the development of the front-end visualization page, more accurately match the component color with the background color, quantify the selection of component colors, and leave a reuse basis for future development.
[0105] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with this technical field within the technical scope disclosed by the present invention should be covered by the scope of protection of the present invention.
Claims
1. A method for automatic page color matching, characterized in that: include: Establish a color template library based on different color schemes; Establish an initial background color learning model; The initial background color learning model is trained based on the page color matching examples and the color template library to obtain a fully trained target background color learning model, wherein the page color matching examples are historical data of manual page color matching; Determining component colors of a page to be color matched based on the fully trained target background color learning model and the color template library includes: After the background color of the page to be color-matched is input into the fully trained target background color learning model, the fully trained target background color learning model searches for corresponding component colors according to the color system template library. If the corresponding component colors exist in the color system template library, the corresponding component colors are output; if the corresponding component colors do not exist in the color system template library, the corresponding component colors are configured using a first preset method, where the first preset method is manual color matching; Inputting the corresponding component color configured in the first preset manner and the background color of the page to be color-matched into the trained target background color learning model, calculating a learning coefficient, and adding the learning coefficient to the trained target background color learning model; If the color template library exists after the corresponding component color, it also includes: Determining whether the corresponding component color in the color template library meets a preset standard, and if so, outputting the corresponding component color in the color template library; If it does not meet the standards, the corresponding component color is configured using the second preset method; Configuring the corresponding component color through the second preset method includes: Then, according to the corresponding component color output by the trained target background color learning model, a similar color is selected as the corresponding component color; The similar colors and the background color of the page to be color-matched are input into the fully trained target background color learning model, a learning coefficient is calculated, and the learning coefficient is added to the fully trained target background color learning model.
2. The automatic page color matching method according to claim 1, characterized in that: The initial background color learning model is: ; Among them, Y represents the component color, represents the learning coefficient, Indicates the background color around the component. Represents a nested algorithm.
3. The automatic page color matching method according to claim 2, characterized in that: The initial background color learning model is trained based on the page color matching example and the color template library to obtain a fully trained target background color learning model, including: Obtaining page color matching instance history data, wherein the page color matching instance history data includes page background color and page component colors; Taking the page background color and the page component color as input, inputting them into the initial background color learning model, and determining a learning coefficient; The initial background color learning model is trained according to the page color matching instance historical data and the learning coefficient to obtain the fully trained target background color learning model.
4. A page automatic color matching device, characterized in that: include: The color system module is used to build a color system template library based on different color systems; Modeling module, used to establish the initial background color learning model; an optimization module for optimizing the initial background color learning model based on page color matching examples and the color template library to obtain a fully trained target background color learning model, wherein the page color matching examples are historical data of manual page color matching; The color matching module is used to determine the component colors of the page to be matched based on the trained target background color learning model and the color template library, including: After the background color of the page to be color-matched is input into the fully trained target background color learning model, the fully trained target background color learning model searches for corresponding component colors according to the color system template library. If the corresponding component colors exist in the color system template library, the corresponding component colors are output; if the corresponding component colors do not exist in the color system template library, the corresponding component colors are configured using a first preset method, where the first preset method is manual color matching; Inputting the corresponding component color configured in the first preset manner and the background color of the page to be color-matched into the trained target background color learning model, calculating a learning coefficient, and adding the learning coefficient to the trained target background color learning model; If the color template library exists after the corresponding component color, it also includes: Determining whether the corresponding component color in the color template library meets a preset standard, and if so, outputting the corresponding component color in the color template library; If it does not meet the standards, the corresponding component color is configured using the second preset method; Configuring the corresponding component color through the second preset method includes: Then, according to the corresponding component color output by the trained target background color learning model, a similar color is selected as the corresponding component color; The similar colors and the background color of the page to be color-matched are input into the fully trained target background color learning model, a learning coefficient is calculated, and the learning coefficient is added to the fully trained target background color learning model.
5. An electronic device, characterized in that: comprising a memory and a processor, wherein, The memory is used to store programs; The processor is coupled to the memory and is configured to execute the program stored in the memory to implement the steps of the automatic page color matching method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps of the page automatic color matching method described in any one of claims 1 to 3.
Citation Information
Patent Citations
Page generation method and device, equipment and storage medium
CN113742025A