Search

CN-121999074-A - Page color scheme generation method, system and related device

CN121999074ACN 121999074 ACN121999074 ACN 121999074ACN-121999074-A

Abstract

The application discloses a method, a system and a related device for generating a color scheme of a page, which relate to the field of page design and comprise the steps of extracting a plurality of colors from a theme graph of the page, obtaining the area ratio of each color in the theme graph and the color characteristics of each color, calculating color characteristic scores, weighting and grading the area ratio and the color characteristic scores to obtain the total score of each color, screening out a plurality of candidate colors according to the total score, calculating the correlation score of each candidate color and the theme type of the theme graph, taking the candidate color with the highest correlation score as a main color, generating auxiliary colors of the main color according to the main and auxiliary color requirements of a color application scene of the page, generating the spot colors of the main color and the auxiliary color according to the preset color matching rule, and pairing the spot colors, the main color and the plurality of auxiliary colors of the main color to generate at least one color scheme of the page. According to the application, at least one color scheme of the page is automatically generated according to the theme drawings, and the efficiency of page color matching is improved.

Inventors

  • Request for anonymity
  • Request for anonymity
  • Request for anonymity
  • Request for anonymity
  • Request for anonymity
  • Request for anonymity

Assignees

  • 携程旅游网络技术(上海)有限公司

Dates

Publication Date
20260508
Application Date
20260129

Claims (10)

  1. 1. The page color scheme generation method is characterized by comprising the following steps of: extracting a plurality of different colors from a topic map of a page; Acquiring the area ratio of each extracted color in the theme graph, acquiring the color characteristics of each extracted color, and calculating the color characteristic score of each color; Weighting and scoring the area ratio of each color and the color characteristic score to obtain a total score of each color, and screening a plurality of candidate colors from the plurality of colors according to the total score, wherein the total score of each candidate color is larger than that of other colors; calculating a correlation score between each candidate color and the topic type of the topic map, and taking the candidate color with the highest correlation score as a main color; generating at least one auxiliary color of the main color according to a preset color matching rule and main and auxiliary color requirements of a color application scene of the page, and generating the spot colors of the main color and the auxiliary color according to the preset color matching rule; Pairing the interspersed color, the main color and at least one auxiliary color of the main color to generate at least one color matching scheme of the page.
  2. 2. The color scheme generating method of a page according to claim 1, further comprising: Scoring the visual harmony of each color matching scheme by utilizing a pre-trained color matching evaluation model; and if the visual coordination score of the target color scheme is smaller than a threshold value, adjusting auxiliary colors and spot colors in the target color scheme until the visual coordination score of the target color scheme is not smaller than the threshold value, wherein the target color scheme is one color scheme in the at least one color scheme.
  3. 3. The method for generating a color scheme for a page according to claim 2, wherein said adjusting the auxiliary color and the spot color in the target color scheme comprises: adjusting the hue of the auxiliary color in the target color matching scheme to obtain a first auxiliary color, and generating a first spot color of the main color and the first auxiliary color according to the preset color matching rule to obtain an adjusted target color matching scheme; judging whether the visual coordination score of the adjusted target color scheme is smaller than the threshold value, if not, stopping adjusting, outputting the adjusted target color scheme, if so, adjusting the saturation of a first auxiliary color in the adjusted target color scheme to obtain a second auxiliary color, and generating second spot colors of the main color and the second auxiliary color according to the preset color matching rule to obtain a secondary adjusted color scheme; Judging whether the visual harmony fraction of the color matching scheme after secondary adjustment is smaller than the threshold value, if not, stopping adjustment, outputting the color matching scheme after secondary adjustment, and if so, judging the magnitude relation between the iteration times and the iteration threshold value; if the iteration times are smaller than the iteration threshold, taking the color matching scheme after the secondary adjustment as the target color matching scheme, and returning to the step of executing the adjustment of the hue of the auxiliary color in the target color matching scheme; and if the iteration times are not smaller than the iteration threshold, stopping adjusting, selecting a third auxiliary color of the main color from the plurality of candidate colors, generating a third decoration color of the main color and the third auxiliary color according to the preset color matching rule, and outputting a color matching scheme containing the main color, the third auxiliary color and the third decoration color.
  4. 4. The method for generating a color scheme for a page according to claim 1, wherein said calculating a correlation score between each candidate color and a topic type of the topic map comprises: identifying the topic type of the topic map, and acquiring a hue range corresponding to the topic type from a preset topic type-color mapping library; If the hue angle of the target color is in the hue angle range corresponding to the hue range on the hue ring, the correlation score of the target color is full, and the target color is one candidate color of a plurality of candidate colors; If the hue angle of the target color is not in the hue angle range on the hue ring, calculating the minimum angle difference between the hue angle of the target color and the hue angle range; And calculating a hue attenuation score corresponding to the minimum angle difference, calculating a calculation result of subtracting the hue attenuation score from the full score, and taking the calculation result as a correlation score of the target color.
  5. 5. The color scheme generating method of a page according to claim 1, further comprising: and if the dominant color does not meet the requirement of the dominant color of the color application scene, reselecting an alternative color of the dominant color from a plurality of candidate colors, and taking the alternative color as the dominant color.
  6. 6. The method for generating a color scheme for a page according to claim 1, wherein the preset color scheme rule includes a same-color system rule or an adjacent-color rule; The generating at least one auxiliary color of the main color according to a preset color matching rule and main and auxiliary color requirements of a color application scene of the page comprises the following steps: Adjusting the brightness or saturation of the main color according to the same color system rule to generate a plurality of auxiliary color candidates of the main color, or selecting colors adjacent to the main color on a hue circle according to an adjacent color rule to generate a plurality of auxiliary color candidates of the main color; and taking at least one auxiliary color candidate meeting the main and auxiliary color requirements as at least one auxiliary color of the main color from the plurality of auxiliary color candidates.
  7. 7. The method for generating a color scheme for a page according to claim 1, wherein the extracting a plurality of different colors from a theme graph of the page comprises: Analyzing the theme graph, and determining the colors contained in the theme graph, and the saturation, contrast and brightness of each color; Judging whether the saturation, contrast and brightness of each color meet corresponding thresholds or not respectively; extracting the colors meeting at least two thresholds to obtain a plurality of different colors extracted from the theme graph.
  8. 8. The system for generating the color scheme of the page is characterized in that the method for generating the color scheme of the page comprises the following steps: an extraction unit for extracting a plurality of different colors from a topic map of a page; The processing unit is used for acquiring the area ratio of each extracted color in the theme graph, acquiring the color characteristics of each extracted color and calculating the color characteristic score of each color; The scoring unit is used for weighting and scoring the area ratio and the color characteristic score of each color to obtain a total score of each color, and screening a plurality of candidate colors from the plurality of colors according to the total score, wherein the total score of the candidate colors is larger than that of other colors; A calculating unit, configured to calculate a correlation score between each candidate color and a topic type of the topic map, and take a candidate color with the highest correlation score as a dominant color; the color matching unit is used for generating at least one auxiliary color of the main color according to a preset color matching rule and main and auxiliary color requirements of a color application scene of the page, and generating the spot colors of the main color and the auxiliary color according to the preset color matching rule; and the generating unit is used for pairing the interspersed color, the main color and at least one auxiliary color of the main color to generate at least one color matching scheme of the page.
  9. 9. An electronic device comprising at least one processor and a memory coupled to the processor, wherein: the memory is used for storing a computer program; the processor is configured to execute the computer program to enable the electronic device to implement the color scheme generation method of a page according to any one of claims 1 to 7.
  10. 10. A computer program product comprising computer readable instructions which, when run on an electronic device, cause the electronic device to implement a method of colour scheme generation for a page as claimed in any one of claims 1 to 7.

Description

Page color scheme generation method, system and related device Technical Field The application relates to the technical field of page design, in particular to a method, a system and a related device for generating a color scheme of a page. Background In the process of designing a page, color matching is often selected for each element (such as a page background, a page frame, a page icon and the like) in the page according to a theme graph of the page, so that color matching of each element of the page and the theme graph is realized. The theme pictures can refer to image materials carrying page core information, such as commodity real shot images in commodity detail pages or activity scene real shot pictures of activity top pages. In the current page color matching process, the color matching of page elements is mainly selected manually according to a theme graph, and when the number of page color matching services is large, the efficiency of manual color matching is low. Disclosure of Invention In view of the above problems, the present application provides a method, a system, and a related device for generating a color scheme of a page, so as to achieve the purpose of improving the color efficiency of the page. The specific scheme is as follows: the first aspect of the present application provides a method for generating a color scheme of a page, where the method for generating a color scheme of a page includes: extracting a plurality of different colors from a topic map of a page; Acquiring the area ratio of each extracted color in the theme graph, acquiring the color characteristics of each extracted color, and calculating the color characteristic score of each color; Weighting and scoring the area ratio of each color and the color characteristic score to obtain a total score of each color, and screening a plurality of candidate colors from the plurality of colors according to the total score, wherein the total score of each candidate color is larger than that of other colors; calculating a correlation score between each candidate color and the topic type of the topic map, and taking the candidate color with the highest correlation score as a main color; generating at least one auxiliary color of the main color according to a preset color matching rule and main and auxiliary color requirements of a color application scene of the page, and generating the spot colors of the main color and the auxiliary color according to the preset color matching rule; Pairing the interspersed color, the main color and at least one auxiliary color of the main color to generate at least one color matching scheme of the page. In one possible implementation, the method further includes: Scoring the visual harmony of each color matching scheme by utilizing a pre-trained color matching evaluation model; and if the visual coordination score of the target color scheme is smaller than a threshold value, adjusting auxiliary colors and spot colors in the target color scheme until the visual coordination score of the target color scheme is not smaller than the threshold value, wherein the target color scheme is one color scheme in the at least one color scheme. In one possible implementation, the adjusting the secondary colors and the interspersed colors in the target color scheme includes: adjusting the hue of the auxiliary color in the target color matching scheme to obtain a first auxiliary color, and generating a first spot color of the main color and the first auxiliary color according to the preset color matching rule to obtain an adjusted target color matching scheme; judging whether the visual coordination score of the adjusted target color scheme is smaller than the threshold value, if not, stopping adjusting, outputting the adjusted target color scheme, if so, adjusting the saturation of a first auxiliary color in the adjusted target color scheme to obtain a second auxiliary color, and generating second spot colors of the main color and the second auxiliary color according to the preset color matching rule to obtain a secondary adjusted color scheme; Judging whether the visual harmony fraction of the color matching scheme after secondary adjustment is smaller than the threshold value, if not, stopping adjustment, outputting the color matching scheme after secondary adjustment, and if so, judging the magnitude relation between the iteration times and the iteration threshold value; if the iteration times are smaller than the iteration threshold, taking the color matching scheme after the secondary adjustment as the target color matching scheme, and returning to the step of executing the adjustment of the hue of the auxiliary color in the target color matching scheme; and if the iteration times are not smaller than the iteration threshold, stopping adjusting, selecting a third auxiliary color of the main color from the plurality of candidate colors, generating a third decoration color of the main color and the third auxiliar