Color matching scheme generation method and device, equipment and storage medium

By performing standardized preprocessing and cluster analysis on color source images, and combining them with an image semantic understanding model, a color scheme that supports multi-scene adaptation is generated. This solves the problem of insufficient understanding of color relationships in existing technologies and achieves accurate extraction of primary, secondary, and background colors, as well as enhanced sense of hierarchy.

CN122023210APending Publication Date: 2026-05-12PCI TECH GRP CO LTD +4
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-05
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing color picking algorithms cannot understand the relationships between colors, resulting in a color palette that lacks hierarchy, cannot distinguish between the main object and the background, is difficult to be compatible with the brand's base color system, and lacks semantic mapping.

Method used

By standardizing and preprocessing the color source images, performing pixel sampling and cluster analysis, and using a pre-trained image semantic understanding model to identify emotion tags in the color spectrum information, a color scheme that can be transferred to different types of user terminals is generated.

Benefits of technology

It achieves accurate extraction of primary color, secondary color, and background color, and the generated color scheme conforms to the user-end design specifications, supports multi-scene adaptation, and improves the hierarchy and consistency of the color scheme.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122023210A_ABST
    Figure CN122023210A_ABST
Patent Text Reader

Abstract

The invention discloses a color matching scheme generation method and device, equipment and a storage medium. The color matching scheme generation method comprises the following steps: carrying out standardized preprocessing on a color source image; performing pixel sampling and clustering analysis on the standardized color source image to obtain chromatographic information of the color source image; and identifying an emotion label contained in the chromatographic information through a pre-trained image semantic understanding model to obtain a color matching scheme corresponding to the color source image. In this way, the accurate color matching scheme can be generated based on semantics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of product color matching, and in particular to a method, apparatus, device and storage medium for generating color matching schemes. Background Technology

[0002] In existing technologies, color picking algorithms mainly employ clustering methods such as k-means, median cut, and histogram peak. While these methods can identify the dominant color in an image, they fail to understand the relationships between colors, resulting in several very similar hues and a lack of hierarchy. The algorithm cannot distinguish which part of the image is the main object and which is the background. Due to the lack of semantic mapping, existing technologies struggle to differentiate between colors applied to backgrounds and text, rendering the resulting color palettes unusable directly. Furthermore, they lack dynamic hierarchical design or conflict with the original system based on brand primary colors. Summary of the Invention

[0003] This application mainly provides a method, apparatus, device and storage medium for generating color schemes to solve the problem of poor image color extraction effect.

[0004] To address the aforementioned technical problems, this application provides a method for generating color schemes, comprising: performing standardized preprocessing on a color source image; performing pixel sampling and cluster analysis on the standardized color source image to obtain chromatographic information of the color source image; and identifying the emotion tags contained in the chromatographic information through a pre-trained image semantic understanding model to obtain a color scheme corresponding to the color source image, wherein the color scheme supports migration to different types of user terminals.

[0005] In some embodiments, the step of performing pixel sampling on the standardized color source image includes: performing pixel sampling on the standardized color source image using a color sampler; and setting a weight value corresponding to each color based on the frequency of occurrence of each color after sampling.

[0006] In some embodiments, the step of performing cluster analysis on the standardized color source image to obtain the color spectrum information of the color source image includes: clustering the primary color, secondary color, and background color using a cluster analyzer based on the hue distribution in the neighborhood of each color on the color wheel and the distance from the target chromaticity value; and fusing the color values ​​of each type of color after clustering with the weight values ​​corresponding to each color to obtain the color spectrum information.

[0007] In some embodiments, the step of identifying the emotion tags contained in the color spectrum information through a pre-trained image semantic understanding model to obtain a color scheme includes: extracting high-level visual features and emotional semantic information from the color spectrum information using the pre-trained image semantic understanding model; identifying the emotion of the color source image based on the high-level visual features and the emotional semantic information, and labeling the corresponding emotion tag; and performing semantic mapping of the emotion tag based on a color psychology database to obtain a color scheme for the color source image.

[0008] In some embodiments, after obtaining the color scheme of the color source image, the method further includes: adjusting the color ratio and color level of the color scheme based on the user's style type.

[0009] In some embodiments, the standardization preprocessing of the color source image includes: receiving color source images of different formats through an image upload interface; and automatically adjusting the brightness, contrast, and white balance of the color source image through a color normalizer.

[0010] In some embodiments, after obtaining the color scheme corresponding to the color source image, the method further includes: converting the color scheme to a general mode using a format converter; generating a dark mode color scheme and a high contrast mode color scheme corresponding to the color scheme; and exporting the color schemes in general mode, dark mode, and high contrast mode.

[0011] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a color scheme generation device, comprising: a preprocessing module for standardizing a color source image; a clustering module for performing pixel sampling and cluster analysis on the standardized color source image to obtain the color spectrum information of the color source image; and a color scheme generation module for identifying the emotion tags contained in the color spectrum information through a pre-trained image semantic understanding model to obtain a color scheme corresponding to the color source image, wherein the color scheme supports migration to different types of user terminals.

[0012] This application also provides a computer device, the computer device comprising: a memory and at least one processor, the memory storing instructions; the at least one processor calling the instructions in the memory to cause the computer device to execute the color scheme generation method as described above.

[0013] This application also provides a computer-readable storage medium storing instructions that, when executed by a processor, implement the color scheme generation method described above.

[0014] The beneficial effects of this application are as follows: Unlike existing technologies, this application discloses a color scheme generation method, apparatus, device, and storage medium. It performs standardized preprocessing on the color source image; by adjusting brightness, contrast, and white balance, it unifies the image color benchmark under different shooting conditions, avoiding color extraction deviations caused by differences in lighting and equipment. The standardized color source image undergoes pixel sampling and cluster analysis to obtain the color spectrum information of the color source image; it not only extracts the primary color but also filters logically related auxiliary and background colors based on color wheel distribution and chromaticity values, solving the problem of traditional algorithms only finding the primary color and lacking hierarchy. A pre-trained image semantic understanding model identifies the emotional tags contained in the color spectrum information to obtain the color scheme corresponding to the color source image. The color scheme can be transferred to different types of user terminals, transforming abstract emotions into specific color rules, adjusting color proportions and levels according to the target type, solving the problem that traditional tools produce beautiful color schemes but cannot be directly applied. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort, wherein: Figure 1 This is a flowchart illustrating an embodiment of the color scheme generation method provided in this application; Figure 2 Is it like this? Figure 1 The flowchart of step 100 of the method shown is a schematic diagram of an embodiment. Figure 3 Is it like this? Figure 1 The flowchart of step 200 of the method shown is a schematic diagram of one embodiment; Figure 4 Is it like this? Figure 1 A flowchart illustrating another embodiment of method step 200 is shown. Figure 5 Is it like this? Figure 1 The flowchart of step 300 of the method shown is a schematic diagram of an embodiment; Figure 6 Is it like this? Figure 1 A flowchart illustrating another embodiment of the method steps shown; Figure 7 This is a schematic diagram of an embodiment of the color scheme generation apparatus provided in this application; Figure 8 This is a schematic diagram of the structure of a computer device according to an embodiment of this application. Detailed Implementation

[0016] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0017] The terms "first," "second," and "third" used in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0018] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0019] See Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the color scheme generation method provided in this application. The color scheme generation method includes the following steps: 100: Perform standardization preprocessing on the color source image.

[0020] It receives user-uploaded images in JPG / PNG formats and converts them into system-compatible digital image formats; it automatically adjusts the images to eliminate color deviations caused by differences in shooting environment, such as backlighting and color cast; and it standardizes image pixel dimensions to ensure consistent input for subsequent feature extraction algorithms.

[0021] Color source images are the original images that users input into the system. They are the basic data source for generating color schemes and can be any image containing extractable color features, such as natural scenery, brand logos, or works of art.

[0022] Optionally, the color source image can be obtained through methods such as camera shooting, video capture, or intelligent generation; this application does not impose any restrictions on this.

[0023] Standardizing image format and size provides consistent input for subsequent clustering analysis algorithms, avoiding biases in primary / secondary color extraction caused by differences in image resolution or size. Preprocessed images exhibit purer color features, enabling AI models to more accurately identify sentiment tags and laying a high-quality data foundation for color scheme generation.

[0024] Further, see Figure 1 Step 100 also includes the following steps: 110: Receive color source images of different formats through the image upload interface.

[0025] The image upload interface is the system's entry point for receiving color source images, supporting common image formats such as JPG and PNG. It receives user-uploaded color source images through a standardized interface protocol, automatically verifying file format and integrity to ensure correct image data transmission to the system.

[0026] By breaking format limitations through the image upload interface, it is compatible with images taken by different devices such as mobile phones and cameras, providing diverse raw data for subsequent processing; at the same time, it filters out damaged or unsupported files through interface verification to prevent invalid data from entering the system.

[0027] 120: Automatically adjusts the brightness, contrast, and white balance of the color source image using a color normalizer.

[0028] The color normalizer is a core component for preprocessing color source images, automatically adjusting the image's brightness, contrast, and white balance parameters through algorithms.

[0029] Specifically, brightness adjustment includes correcting overexposed or underexposed areas, such as increasing the brightness of dark areas caused by backlighting by 15% to 20% to ensure clear image color details.

[0030] Contrast optimization includes enhancing the sense of depth in colors within an image, such as widening the difference between highlights and shadows, to avoid a "dull" effect caused by insufficient contrast.

[0031] White balance correction includes eliminating ambient light color casts, such as the yellow shift in warm light environments, and unifying the color temperature reference of the image, such as correcting it to 6500K standard white light.

[0032] By adjusting the color source image through a color normalizer, the color benchmark of images under different shooting conditions is unified, avoiding color extraction deviations caused by differences in lighting and equipment; the output RGB color space data that meets the system processing requirements provides consistent input for the subsequent clustering analysis of the Celebi algorithm, ensuring the stability of the primary and secondary color extraction results and solving the problem of color matching randomness caused by image quality fluctuations in traditional algorithms; by optimizing the brightness and contrast of the image, the color features are made more significant, reducing the error of subsequent AI models in the recognition of emotion tags.

[0033] Steps 110 and 120 together constitute a standardized preprocessing flow for color source images. By using an interface compatible with diverse inputs and algorithms to eliminate environmental interference, it provides high-quality and consistent image data for subsequent color feature extraction and AI sentiment analysis, ensuring the accuracy and stability of color matching schemes from the source.

[0034] 200: Perform pixel sampling and cluster analysis on the standardized color source image to obtain the color spectrum information of the color source image.

[0035] The system performs pixel-level scanning of the standardized color source image using a color sampler, prioritizing the acquisition of frequently occurring colors in the image and assigning weights to different regions to ensure that the extracted colors reflect the core visual features of the image. Based on the Celebi algorithm, the sampled pixels are segmented into a color space, and colors are recursively clustered into sets with similar hues, saturation, and brightness.

[0036] Among them, the color spectrum information is a set of structured color data extracted from color source images through pixel sampling and cluster analysis, which includes information such as color roles, color value parameters, weight distribution, and sentiment tag associations.

[0037] Cluster analysis is used to distinguish between primary color, secondary color, and background color, avoiding the problem of similar color tones being piled up by traditional color picking algorithms.

[0038] See Figure 3 Furthermore, the standardized color source image is subjected to pixel sampling, including the following steps: 210: Pixel sampling is performed on the standardized color source image using a color sampler.

[0039] The color sampler performs a gridded scan on the standardized color source image, dividing the image into 10×10 pixel grids, and randomly extracting the color values ​​(RGB / HSV) of 5 to 10 pixels within each grid.

[0040] Optionally, for detected visual focus areas, such as within the outline of a subject identified through edge detection, the sampling density is increased by 50% to ensure that the core color is fully captured.

[0041] The color sampler is the core component of the color feature extraction module, used to perform pixel-level scanning and data acquisition on the standardized color source image.

[0042] The color sampler prioritizes sampling pixels in visually focal areas of the image, such as the main subject and high-contrast regions, while allocating a lower sampling frequency to background pixels to ensure that the extracted colors reflect the core visual features of the image. For example, in a portrait image, it prioritizes sampling the skin tone of the person rather than the background sky.

[0043] The color sampler records the number of times each color appears in the sampled pixels, represented by RGB / HSV values, providing raw data for subsequent weight calculations.

[0044] By prioritizing region sampling and weighting, we avoid misjudging high-frequency but meaningless colors in the background as primary colors, ensuring that the extracted colors are concentrated on the visual subject of the image.

[0045] 220: Based on the frequency of each color after sampling, set the weight value corresponding to each color.

[0046] Count the number of times each color appears in the sampled pixels and calculate the frequency. For example, if color A appears 800 times and there are 10,000 sampled pixels, the frequency is 8%. Using a region weighting rule, multiply the color frequency in the focal region by a coefficient of 1.2 to 1.3. For example, the frequency of color A in the focal region is corrected to 8% × 1.3 = 10.4%.

[0047] The final weight values ​​are expressed as percentages. For example, color A has a weight of 10.4%, and color B has a weight of 5.2%, which serves as an important basis for subsequent cluster analysis.

[0048] The weight values ​​for each color are assigned based on the frequency of occurrence and regional importance of the sampled color, and are used to quantify the visual proportion of different colors in the color source image. Colors with higher frequency of occurrence have larger weight values. For example, a blue pixel that appears 1000 times has a higher weight value than a green pixel that appears only 100 times.

[0049] Based on the weight settings of frequency and region, the generated color scheme is ensured to be highly consistent with the visual style of the color source image.

[0050] Optionally, for visual focus areas, such as the main body area located by image recognition, the color weight is increased by an additional 20% to 30% to avoid interference from the background color on the extraction of the main color.

[0051] The weight values ​​quantify the visual importance of colors, enabling the Celebi algorithm to prioritize high-weight colors during clustering, resulting in a clear color spectrum and avoiding the pitfalls of traditional algorithms that overuse similar hues. These weight values ​​also provide data support for subsequent AI models to adjust color proportions, ensuring color schemes conform to UI design guidelines.

[0052] See Figure 4 Furthermore, the standardized color source images are subjected to cluster analysis to obtain the chromatographic information of the color source images, including the following steps: 230: Based on the hue distribution within the neighborhood of each color on the color wheel and the distance from the target chromaticity value, clustering is performed on the primary color, secondary color, and background color using a cluster analyzer.

[0053] The cluster analyzer is based on the Celebi algorithm and classifies the sampled colors according to different rules.

[0054] For primary color selection, priority is given to clusters with uniform hue distribution within the color wheel neighborhood and the smallest distance from the target chromaticity value of 48.0; the highest weighting is required to ensure visual dominance.

[0055] Optionally, non-overlapping colors within 30 degrees and covering complementary colors are considered to have a uniform hue distribution in the neighborhood of the color wheel; the highest weight ratio is at least greater than 40%.

[0056] For selecting secondary colors, choose 1-2 contrasting colors outside the neighborhood of the primary color. For example, if the primary color is blue, orange can be chosen as the secondary color. Optionally, 30 degrees is considered to be outside the neighborhood of the primary color.

[0057] Optionally, the saturation of the secondary color can deviate from the target value of 48.0 within ±10, with a weighting of 20% to 30%.

[0058] For background color filtering, choose colors with low saturation and high brightness.

[0059] Optionally, the weighting percentage can be dynamically adjusted based on the UI style. For example, the background color percentage may be greater than 50% for business apps, while it may be reduced to 40% for social apps.

[0060] Optionally, a deviation of more than 20 from the target value of 48.0 is considered low saturation.

[0061] For example, for a landscape image containing blue sky, white clouds, and sunset, with a blue saturation of 45.0, a white saturation of 5.0, and an orange saturation of 42.0, the clustering result of the image is: primary color: blue, distance from target value 3.0, weight 55%; secondary color: orange, distance from target value 6.0, weight 25%; background color: white, distance from target value 43.0, weight 20%.

[0062] By using color wheel neighborhood distribution rules, we ensure that the primary and secondary colors contrast in hue, avoiding the monotonous color schemes of traditional algorithms that pile up the same color family, thus enhancing the UI's sense of hierarchy. Target chroma value distance filtering ensures that high-saturation colors become the primary colors, preventing low-saturation background colors from being mistakenly identified as the primary color, and resolving background interference issues.

[0063] Deterministic rule-based clustering avoids the problem of large color differences when extracting the same image multiple times due to randomness in traditional algorithms, thus ensuring the consistency of the designed system.

[0064] 240: Combine the color values ​​of each color after clustering with the corresponding weight values ​​of each color to generate color spectrum information.

[0065] The clustered color values ​​are associated with their weight values ​​to form structured data; each color is labeled with a primary color / secondary color / background color and associated with emotional tendencies, such as blue corresponding to "technological feel" and orange corresponding to "vitality", forming complete color spectrum information.

[0066] The weight values ​​in the color spectrum information provide a basis for subsequent AI models to adjust the color ratios, ensuring that the color schemes conform to the UI specifications of different app types. Through scientific clustering rules and data fusion logic, the original image colors are transformed into structured color spectrum information that can be directly used for UI development, providing core technical support for the intelligent and standardized color matching of apps.

[0067] 300: By using a pre-trained image semantic understanding model to identify the emotion tags contained in the color spectrum information, a color scheme corresponding to the color source image can be obtained. The color scheme can be transferred to different types of user terminals.

[0068] The pre-trained image semantic understanding model performs sentiment analysis on color combinations in chromatographic information and outputs emotion tags such as "warmth", "technological", and "calm". Combining a color sentiment dictionary with UI style templates, the emotion tags are mapped to specific color application rules. A standardized JSON format color scheme is generated, which is automatically compatible with the design specifications of different user terminals such as Android, iOS, and HarmonyOS.

[0069] Among them, the image semantic understanding model is a pre-trained visual model based on the Transformer architecture, such as the ViT model. It captures the emotional association features of colors in the color spectrum information through the self-attention mechanism. For example, red is often associated with "vitality" and blue is associated with "trust", realizing the mapping from color combination to emotion label.

[0070] Emotional labels are keywords that describe the emotions output by an image semantic understanding model. They are used to quantify the visual emotions conveyed by color source images. For example, warm colors such as red and orange correspond to "warmth" and "vitality"; cool colors such as blue and purple correspond to "technological feel" and "calmness"; and low-saturation colors correspond to "simplicity" and "professionalism".

[0071] By using emotion tags, the visual emotions of color source images are transformed into practical color matching rules, solving the problem that traditional algorithms only extract color but do not express meaning.

[0072] A color scheme is a structured collection of color data generated by combining emotion tags and UI design guidelines, including information such as color roles, application rules, and cross-platform parameters.

[0073] Further, see Figure 5 Step 300 also includes the following steps: 310: Extract high-level visual features and emotional semantic information from chromatographic information using a pre-trained image semantic understanding model.

[0074] Pre-trained image semantic understanding models, such as the ViT model, are used to perform in-depth analysis of chromatographic information. The model captures the combination patterns and distribution characteristics of colors in the chromatogram through a self-attention mechanism, transforming them into abstract high-level visual features; at the same time, it combines a color sentiment dictionary to analyze the emotional tendencies implied by color combinations, forming emotional semantic information.

[0075] Among them, high-level visual features refer to the abstract color combination features extracted from the color spectrum information, rather than the color value of a single pixel, including the hue distance between the primary and secondary colors, the distribution ratio of color weights, and the overall hue tendency.

[0076] Emotional semantic information refers to the emotional meaning conveyed by color combinations through color psychology. For example, a combination of dark blue and gray conveys "professionalism" and "reliability"; a combination of bright yellow and white conveys "energy" and "relaxation"; and the low-saturation Morandi color scheme conveys "simplicity" and "sophistication".

[0077] 320: Based on high-level visual features and emotional semantic information, identify the emotion of color source images and label the corresponding emotion tags.

[0078] Based on high-level visual features and emotional semantic information, the emotion classifier of the AI ​​model processing module outputs emotion labels.

[0079] For example, if cool colors (blue / green) account for more than 60% of the visual features of a high-rise building and have high contrast, it is labeled as "technological" based on the "rational" and "calm" tendencies in the emotional semantic information; if warm colors (red / orange) account for more than 50% and have medium saturation, it is labeled as "warm" based on the "energetic" and "enthusiastic" tendencies; ultimately, 1-2 core emotional labels are used.

[0080] By extracting emotional semantic information, the color scheme can be made consistent with the emotion of the color source image (such as generating a "tech-savvy" color scheme from a starry sky image, rather than a random color combination), thereby enhancing the user's emotional resonance.

[0081] 330: Based on a color psychology database, semantic mapping of emotion tags is performed to obtain color schemes for color source images.

[0082] Mapping emotion tags to specific UI color scheme rules using a color psychology database. For example, the "tech-savvy" tag corresponds to the database rule of "blue-purple main color + high-contrast text color + low-saturation background color". Combined with UI style templates, the application specifications of each color in UI elements such as buttons, text, and backgrounds are determined, ultimately forming a structured color scheme.

[0083] Based on a pre-trained model and a color psychology database, the difference rate of color matching extracted from the same image multiple times is less than 5%, which solves the problem of instability in the design system caused by the randomness of traditional algorithms.

[0084] Among them, the color scheme of the color source image is a structured color set that can be directly used for App development based on emotion tags.

[0085] Specifically, the color scheme includes color roles, such as primary color, secondary color, text color, and background color; application rules, that is, the specific use of each color in UI elements, such as the primary color being used for buttons, and the text color needing to meet the WCAG contrast standard; and cross-platform parameters, used to adapt color space conversion data for Android / iOS / HarmonyOS.

[0086] Automatically generates cross-platform compatible JSON solutions, saving the workload of manually adjusting color deviations across different systems. The color scheme clearly defines the rules for color application in UI elements, avoiding the shortcomings of traditional color pickers that "only provide color swatches but not usage instructions," and can be directly imported into the development framework for use.

[0087] By combining mood tags with WCAG contrast correction, such as the "tech" color scheme, the text-to-background contrast ratio is automatically increased to 4.5:1, avoiding unreadable text caused by pursuing aesthetics.

[0088] Optionally, step 330 may also include adjusting the color proportions and color levels of the color scheme based on the user's style type.

[0089] The system calls the corresponding UI style template based on the target App type input by the user; modifies the weight ratio of the main color, secondary color, and background color based on the template rules; and clarifies the application priority of each color in UI elements to form a hierarchical visual guide.

[0090] Among them, the user-side style type is the functional positioning and design style classification of the target mobile application, which determines the visual tone of the color scheme.

[0091] For example, business apps such as financial apps emphasize professionalism and stability, requiring high-contrast, low-saturation color schemes; social apps such as chat apps highlight vitality and approachability, requiring rich auxiliary colors and high-saturation accents; and educational apps such as learning apps focus on clarity and comfort, requiring neutral tones as the main color scheme and soft auxiliary colors.

[0092] The color proportions of a color scheme are the visual weights of the primary color, secondary color, and background color within the scheme, quantified as percentages.

[0093] For example, the primary color, as the dominant visual color, accounts for 50%-60% in business categories and 40%-50% in social categories; the secondary color, as the functional color, accounts for 30%-35% in social categories and 20%-25% in education categories; the background color, as the page background color, accounts for 40%-50% in business categories, and can be increased to 60% in dark mode.

[0094] Color hierarchy refers to the application priority and functional allocation of colors in UI elements, used to form visual guidance logic.

[0095] Optionally, the primary color of the first level is used for core interactive elements, such as buttons and navigation bars; the secondary color of the second level is used for secondary interactive elements, such as icons and labels; and the background / text color of the third level is used for basic containers, such as page background color and body text.

[0096] By precisely matching style with function, we enhance user interaction and overcome the shortcomings of traditional algorithms that rely on a single color scheme to adapt to all scenarios. Through color hierarchy allocation, users can intuitively distinguish core functions (primary color buttons) from secondary information (auxiliary color labels), improving operational efficiency.

[0097] Optionally, if the user already has a primary brand color, such as the company logo color, the system can retain the weight of the primary color when adjusting the color ratio, and only optimize the secondary color and background color, thus avoiding the problem of color matching conflicts with the brand generated by traditional solutions.

[0098] Contrast is dynamically adjusted for different style types to solve the problem of poor user experience in specific scenarios using generic color schemes. Style templates have built-in unified color proportions and hierarchy rules to avoid style confusion caused by manual design and ensure visual consistency across different pages of the same type of app.

[0099] See Figure 6 Optionally, step 300 may be followed by the following steps: 310: Convert the color scheme to a universal mode using a format converter.

[0100] Use a format converter to convert the original color scheme into a cross-platform compatible standard format.

[0101] The general mode is a basic color scheme that adapts to common scenarios. It includes standard color values, role assignments (and UI element application rules), and serves as the benchmark for other modes.

[0102] Optionally, the general mode defaults to a light background, such as white or light gray, with medium contrast, balancing visual comfort and universality, suitable for most lighting environments and users without special needs.

[0103] Optionally, the general mode uses JSON structured storage, which includes color values, weight percentages, and cross-platform color gamut parameters.

[0104] 320: Generate the dark mode color scheme and the high contrast mode color scheme corresponding to the color scheme respectively.

[0105] Based on universal color schemes, dark mode and high contrast mode schemes that conform to visual standards are automatically generated.

[0106] Dark mode is a color scheme based on a dark background. It reduces screen light output by reversing the brightness relationship to adapt to low-light environments or user preferences.

[0107] Optionally, in dark mode, the background color is inverted from the light tone of the general mode to dark gray or black, the hue of the primary and secondary colors remains unchanged, and the brightness is increased as much as possible to ensure visibility against a dark background. The text color is inverted from black to white or light gray.

[0108] High contrast mode is an accessibility color scheme that enhances the contrast between text and background. It improves readability by increasing the difference in color values ​​and is suitable for visually impaired users or bright light environments.

[0109] Optionally, in high contrast mode, the contrast ratio between text color and background color is forced to be ≥4.5:1 or ≥3:1; the saturation of the main / secondary color is reduced to avoid color interference; gradient / semi-transparent effects are removed, and solid color blocks are used to ensure clear boundaries.

[0110] 330: Export color schemes for General Mode, Dark Mode, and High Contrast Mode.

[0111] The three color scheme modes are packaged into a JSON file for direct use by users on Android / iOS / HarmonyOS and other platforms.

[0112] The universal JSON format contains color gamut conversion parameters for Android / iOS / HarmonyOS, ensuring visual consistency of the same color scheme on different system screens and solving the problem of manual adjustment required for traditional tool platform adaptation.

[0113] Dark mode reduces eye strain during nighttime use and extends device battery life; high contrast mode meets accessibility standards, covering the needs of visually impaired users and avoiding difficulties in information access due to insufficient contrast.

[0114] All three modes are generated based on the same set of base color values, ensuring hue consistency between the primary and secondary colors. Only brightness and contrast parameters are adjusted, avoiding stylistic disjointedness between modes caused by manual design. For example, if the primary color of the general mode is blue, the dark mode will still be a blue-based variant.

[0115] The exported JSON file directly contains complete parameters for all three modes, eliminating the need for developers to manually write dark / high contrast adaptation code and reducing color debugging workload.

[0116] By standardizing format conversion and intelligent mode adaptation, a single color scheme is expanded into a full-scene solution covering ordinary scenes, low-light environments, and accessibility needs. This not only solves the shortcomings of traditional algorithm modes, such as being single and having poor compatibility, but also reduces development costs through structured file output, ultimately achieving a one-time generation, multi-terminal adaptation, and full-scene usability improvement in color scheme efficiency.

[0117] By converting user-end style types into quantifiable color parameters, color schemes can satisfy emotional expression and adapt to specific functional scenarios, achieving a unity of aesthetic design and practical experience.

[0118] The color scheme generation method in the embodiments of the present invention has been described above. The color scheme generation apparatus in the embodiments of the present invention will be described below. Please refer to [link / reference]. Figure 7 , Figure 7 This is a schematic diagram of an embodiment of the color scheme generation apparatus provided in this application. The color scheme generation apparatus includes: The preprocessing module is used to perform standardized preprocessing on the color source image.

[0119] The clustering module is used to perform pixel sampling and cluster analysis on the standardized color source image to obtain the color spectrum information of the color source image.

[0120] The color scheme generation module is used to identify the emotion tags contained in the color spectrum information through a pre-trained image semantic understanding model in order to obtain the color scheme corresponding to the color source image. The color scheme can be transferred to different types of user terminals.

[0121] above Figure 7 The color scheme generation device in this embodiment of the invention will be described in detail from the perspective of modular functional entities. The computer device in this embodiment of the invention will be described in detail from the perspective of hardware processing.

[0122] Figure 8This is a schematic diagram of a computer device 500 provided in an embodiment of the present invention. The computer device 500 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) for storing application programs 533 or data 532. The memory 520 and storage media 530 may be temporary or persistent storage. The program stored in the storage media 530 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the computer device 500. Furthermore, the processor 510 may be configured to communicate with the storage media 530 and execute the series of instruction operations in the storage media 530 on the computer device 500.

[0123] Computer device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input / output interfaces 560, and / or one or more operating systems 531, such as Windows Server, MacOSX, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 8 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0124] The present invention also provides a computer device, the computer device including a memory and a processor, the memory storing computer-readable instructions, which, when executed by the processor, cause the processor to perform the steps of the color scheme generation method in the above embodiments.

[0125] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the color scheme generation method.

[0126] Unlike existing technologies, this application ensures the consistency of color features in input images through standardized processing techniques, avoiding deviations in subsequent color extraction caused by overexposure or underexposure of the original image; it provides standardized data for the color feature extraction module, improving the accuracy of primary and secondary color extraction. Through algorithmic clustering analysis, it addresses the problem of traditional k-means / median cut algorithms only clustering color values ​​and ignoring visual hierarchy, achieving structured extraction of primary and secondary colors; it outputs color weight data, providing a foundation for subsequent dynamic hierarchical design. Through intelligent color matching generation via multi-model collaboration, it overcomes the deficiency of traditional algorithms in lacking emotional association, achieving accurate mapping from color combinations to emotional labels; it solves the problem of color matching being disconnected from the scene, generating solutions that conform to functional positioning; it enables personalized iteration, continuously improving the matching degree between the solution and user preferences, solving the problem of fixed and non-optimizable results generated by traditional tools. Through multi-mode adaptation and standardized output, it solves the problem of traditional tools using a single color scheme and being incompatible with multiple scenes, covering the needs of low-light environments and visually impaired users; the JSON format ensures direct application by the development end, avoiding manual secondary conversion and improving development efficiency. Through collaborative work involving data flow, intelligent decision-making, and scene adaptation, end-to-end automation is achieved from image to usable color scheme. It upgrades from passive color picking to proactively understanding scene requirements, generating color schemes that meet emotional, functional, and accessibility standards. Replacing traditional manual color picking and repeated debugging, the color scheme generation cycle is shortened from hours to minutes. Through algorithm standardization and self-learning mechanisms, color discrepancies from multiple extractions of the same image are avoided, ensuring the consistency of the design system. This solves the core shortcomings of traditional color picking tools—lack of semantics, hierarchy, and adaptability—ultimately achieving intelligent generation of the entire chain from image emotion to cross-platform app color schemes.

[0127] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. In particular, the storage medium embodiments and computer device embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0128] This application can be used in a wide range of general-purpose or specialized in-vehicle computing system environments or configurations. Examples include: personal computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, network PCs, minicomputers, and distributed computing environments including any of the above systems or devices.

[0129] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative; multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed.

[0130] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0131] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0132] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for generating a color scheme, characterized in that, include: Standardize the color source image; The standardized color source image is subjected to pixel sampling and cluster analysis to obtain the chromatographic information of the color source image; The color scheme corresponding to the color source image is obtained by identifying the emotion tags contained in the color spectrum information through a pre-trained image semantic understanding model.

2. The color scheme generation method according to claim 1, characterized in that, The step of sampling pixels from the standardized color source image includes: The standardized color source image is pixel-sampled using a color sampler; Based on the frequency of each color after sampling, a weight value is set for each color.

3. The color scheme generation method according to claim 2, characterized in that, The step of performing cluster analysis on the standardized color source image to obtain the chromatographic information of the color source image includes: Based on the hue distribution within the color wheel neighborhood of each color and its distance from the target chromaticity value, a clustering analyzer is used to cluster the primary color, secondary color, and background color. The color values ​​of each color after clustering and the weight values ​​corresponding to each color are combined to obtain the chromatographic information.

4. The color scheme generation method according to claim 1, characterized in that, The step of identifying the emotion tags contained in the color spectrum information through a pre-trained image semantic understanding model to obtain the color scheme corresponding to the color source image includes: The image semantic understanding model, which is pre-trained, extracts high-level visual features and emotional semantic information from the chromatographic information. Based on the high-level visual features and the emotional semantic information, the emotion of the color source image is identified, and the corresponding emotion label is marked. Based on a color psychology database, the semantic mapping of the emotion tags is performed to obtain the color scheme of the color source image.

5. The color scheme generation method according to claim 4, characterized in that, After obtaining the color scheme of the color source image, the method further includes: Adjust the color proportions and color levels of the color scheme based on the user's style type.

6. The color scheme generation method according to claim 1, characterized in that, The standardization preprocessing of the color source image includes: The color source images in different formats are received through the image upload interface; The brightness, contrast, and white balance of the color source image are automatically adjusted using a color normalizer.

7. The color scheme generation method according to claim 1, characterized in that, After obtaining the color scheme corresponding to the color source image, the method further includes: The color scheme is converted to a universal mode using a format converter; Generate the dark mode color scheme and the high contrast mode color scheme corresponding to the color scheme respectively; Export the color schemes for General Mode, Dark Mode, and High Contrast Mode.

8. A color scheme generation device, characterized in that, include: The preprocessing module is used to perform standardized preprocessing on the color source image; The clustering module is used to perform pixel sampling and cluster analysis on the standardized color source image to obtain the chromatographic information of the color source image; The color scheme generation module is used to identify the emotion tags contained in the color spectrum information through a pre-trained image semantic understanding model in order to obtain the color scheme corresponding to the color source image. The color scheme can be transferred to different types of user terminals.

9. A computer device, characterized in that, The computer device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor invokes the instructions in the memory to cause the computer device to execute the color scheme generation method as described in any one of claims 1-7.

10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the color scheme generation method as described in any one of claims 1-7.