CN113032063B - Data processing method and related device - Google Patents

Data processing method and related device Download PDF

Info

Publication number
CN113032063B
CN113032063B CN201911349746.2A CN201911349746A CN113032063B CN 113032063 B CN113032063 B CN 113032063B CN 201911349746 A CN201911349746 A CN 201911349746A CN 113032063 B CN113032063 B CN 113032063B
Authority
CN
China
Prior art keywords
color
value
target
determining
wcag
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911349746.2A
Other languages
Chinese (zh)
Other versions
CN113032063A (en
Inventor
王浩
黄俊涛
马洁浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911349746.2A priority Critical patent/CN113032063B/en
Publication of CN113032063A publication Critical patent/CN113032063A/en
Application granted granted Critical
Publication of CN113032063B publication Critical patent/CN113032063B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Color Image Communication Systems (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the application discloses a data processing method and a related device, which can determine target color values of a main color and a background color on respective color levels through a preset color separation rule when facing massive materials, so that the target materials are dyed after the target colors are obtained, the target materials can be dyed only through the main color and the background color, the materials are not required to be replaced manually, the manufacturing cost is reduced, and the manufacturing efficiency is improved. The data processing method provided by the embodiment of the application comprises the following steps: acquiring a main color and a background color; determining a first target color value on a first color level of the main color and determining a second target color value on a second color level of the background color through a preset color separation rule; and determining a first target color according to the first target color value, determining a second target color according to the second target color value, wherein the first target color and the second target color are used for dyeing the target material, so that the dyed target material is manufactured into a theme pack.

Description

Data processing method and related device
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a data processing method and a related device.
Background
The theme pack is used as a data pack of a beautifying system or a beautifying software interface, and along with popularization of the terminal, the theme pack is widely applied by users, and the requirements of the users on the manufacture of the theme pack are higher and higher.
In order to meet the requirement of users on theme production, users are usually required to manually select materials meeting production requirements from a large number of material resources to adapt to the theme, namely, the users can repeatedly select, replace and modify the colors of characters, icons and the like through manual operation to produce the theme meeting the requirements.
However, the method of replacing individual materials by manual operation of a user to manufacture the theme is high in manufacturing cost and is easy to make mistakes when facing massive materials, so that the efficiency of manufacturing the theme is low.
Disclosure of Invention
The embodiment of the application provides a data processing method and a related device, which are used for determining target color values of a main color and a background color on respective color levels through a preset color separation rule when massive materials are faced, so that the target materials are dyed after the target colors are obtained, the target materials can be dyed only through the main color and the background color, the materials are not required to be replaced manually, the manufacturing cost is reduced, and the manufacturing efficiency is improved.
In a first aspect, an embodiment of the present application provides a method for processing data, including:
Acquiring a main color and a background color;
determining a first target color value on a first color level of the main color and determining a second target color value on a second color level of the background color through a preset color separation rule;
And determining a first target color according to the first target color value, determining a second target color according to the second target color value, wherein the first target color and the second target color are used for dyeing target materials so that the dyed target materials are manufactured into theme packs.
In a second aspect, an embodiment of the present application provides an apparatus for data processing, including:
an acquisition unit configured to acquire a main color and a background color;
A first determining unit configured to determine a first target color value on a first color level of the primary color acquired by the acquiring unit and determine a second target color value on a second color level of the background color acquired by the acquiring unit, by a preset color separation rule;
The second determining unit is used for determining a first target color according to the first target color value determined by the first determining unit, determining a second target color according to the second target color value determined by the first determining unit, and the first target color and the second target color are used for dyeing target materials so that the dyed target materials are manufactured into theme packs.
In a first possible implementation manner of the second aspect of the embodiments of the present application, the first determining unit includes:
a determining module, configured to determine a first gradation value of the primary color and a second gradation value of the background color;
the determining module is configured to determine WCAG values according to the first tone scale value and the second tone scale value;
The judging module is used for judging whether the WCAG values fall into a preset WCAG interval or not;
The determining module is configured to determine, when the determining module determines that the WCAG value falls within the preset WCAG interval, that a color value corresponding to the preset WCAG interval is the first target color value on the first color level, and determine, that a color value corresponding to the preset WCAG interval is the second target color value on the second color level;
the determining module is configured to determine, when the determining module determines that the WCAG value does not fall into the preset WCAG interval, a first color value and a second color value, where a color scale distance between the first color value and a color value corresponding to the preset WCAG interval is the smallest, and a color scale distance between the second color value and a color value corresponding to the preset WCAG interval is the smallest;
the determining module is configured to determine the first color value as the first target color value and determine the second color value as the second target color value.
In a second possible implementation manner of the second aspect of the embodiment of the present application, the determining module includes:
The calculating sub-module is used for calculating the first color level position of the main color and the second color level position of the background color through a distance calculation formula;
And the determining submodule is used for determining the first tone value according to the first tone position and determining the second tone value according to the second tone position.
In a third possible implementation manner of the second aspect of the embodiment of the present application, the acquiring unit includes:
the first acquisition module is used for acquiring an input message, wherein the input message carries a user-defined main color and a background color.
In a fourth possible implementation manner of the second aspect of the embodiment of the present application, the acquiring unit includes:
the second acquisition module is used for acquiring a background image uploaded by a user aiming at the target material;
And the identification module is used for identifying the main color and the background color in the background image.
In a fifth possible implementation manner of the second aspect of the embodiment of the present application, the data processing apparatus further includes:
And the browsing unit is used for browsing the target materials after the target materials are dyed based on the first target color and the second target color through a visual design tool after determining the first target color according to the first target color value and determining the second target color according to the second target color value.
In a sixth possible implementation manner of the second aspect of the embodiment of the present application, the target material includes text, an icon, a background, a bubble, or a button.
In a third aspect, an embodiment of the present application provides a computer-implemented device, including:
comprising the following steps: input/output (I/O) interfaces, a processor and memory,
Program instructions are stored in the memory;
The processor is configured to execute program instructions stored in the memory for implementing a method as described above in any one of the possible implementations of the first aspect.
A fourth aspect of the application provides a computer readable storage medium having stored therein computer executable instructions for performing a method as in any one of the possible implementations of the first aspect.
A fifth aspect of an embodiment of the application provides a computer program product comprising instructions which, when run on a computer or processor, cause the computer or processor to perform the method of any of the above aspects.
From the above technical solutions, the embodiment of the present application has the following advantages:
In the embodiment of the application, after the main color and the background color are obtained, the first target color value is determined on the first color level of the main color and the second target color value is determined on the second color level of the background color through the preset color separation rule, so that the first target color is determined according to the first target color value, the second target color is determined according to the second target color value, the first target color and the second target color can be utilized to dye target materials, even when massive materials are faced, the target color values of the main color and the background color on the respective color levels can be determined through the preset color separation rule, and the target materials can be dyed after the target colors are obtained, so that the target materials can be dyed through the main color and the background color without manually replacing the materials, the manufacturing cost is reduced, and the manufacturing efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic view of an application scenario of data processing in an embodiment of the present application;
FIG. 2 is a schematic diagram of one embodiment of a method of data processing provided in an embodiment of the present application;
FIG. 3 is a first color gradation diagram of a dominant color provided in an embodiment of the present application;
FIG. 4 is a second tone scale schematic of the background color provided in an embodiment of the present application;
FIG. 5 is a schematic diagram of one embodiment of an apparatus for data processing provided in an embodiment of the present application;
FIG. 6 is a schematic diagram of one embodiment of an apparatus for data processing provided in an embodiment of the present application;
Fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides a data processing method and a related device, which are used for determining target color values of a main color and a background color on respective color levels through a preset color separation rule when massive materials are faced, so that the target materials are dyed after the target colors are obtained, the target materials can be dyed only through the main color and the background color, the materials are not required to be replaced manually, the manufacturing cost is reduced, and the manufacturing efficiency is improved.
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. The naming or numbering of the steps in the present application does not mean that the steps in the method flow must be executed according to the time/logic sequence indicated by the naming or numbering, and the execution sequence of the steps in the flow that are named or numbered may be changed according to the technical purpose to be achieved, so long as the same or similar technical effects can be achieved.
The following describes a system architecture adapted to an embodiment of the present application:
The method provided by the embodiment of the application is mainly applied to scenes for making the theme. For example: when the user wants to replace the theme in the terminal device with the favorite theme, the user selects the favorite color, background, etc. to make the self-satisfying theme. However, for making a theme, a user is usually required to manually select a material meeting the making requirement from a large number of material resources to adapt to the theme, that is, the user selects and edits the color of the text, the color of the icon, and the like through manual operation, and the user can make the theme meeting the requirement after repeatedly selecting, replacing and modifying the text, so that the making cost is high, and errors are easy to occur when the user faces a large number of materials, and the efficiency of making the theme is low.
In order to solve the above-mentioned problems, an embodiment of the present application provides a data processing method, which can be applied to an application scenario diagram shown in fig. 1, please refer to fig. 1, which is an application scenario diagram of data processing in the embodiment of the present application. As can be seen from fig. 1, for the QQ product, by using two colors, i.e., yellow for the main color and black for the background color, to make the theme, that is, determining the corresponding target colors by yellow and black, the text, buttons, background, icon, bubbles, etc. in the QQ product can be quickly dyed with the corresponding target colors, so as to make the theme that the user likes.
In addition, it should be noted that the main colors of yellow and the background colors of black in fig. 1 are merely illustrative, and in practical applications, other main colors such as red, green, blue, etc. may be included, and the background colors such as white, gray, etc. are not particularly limited in the embodiments of the present application. It should be noted that, the application scenario described in fig. 1 is applicable to QQ products, but also can be widely applied to products using topics such as WeChat, enterprise WeChat, desktop, etc., and in the embodiment of the present application, only the topic made by QQ products is taken as an example for illustration.
In order to better understand the solution proposed by the embodiment of the present application, a specific flow in this embodiment is described below, referring to fig. 2, which is a schematic diagram of an embodiment of a method for processing data provided in the embodiment of the present application, where the method includes:
201. the primary color and the background color are acquired.
In this embodiment, the dominant color may determine the style of the whole theme and convey the correct theme information, while the background color helps the dominant color to build a more complete image in the whole theme, so that the theme's picture is rich and wonderful. In general, a color with higher saturation and vivid color is selected as the main color in the theme for the main color selection, such as: bright colors such as yellow and red, and dark colors such as gray, black or white are generally selected as background colors. In practical application, the primary color and the background color in the theme can be determined according to the own needs of the user, and the embodiment of the application is not particularly limited.
Alternatively, the primary color and the background color may be obtained from two aspects.
The first way is: and acquiring an input message, wherein the input message carries the user-defined main color and background color. In this embodiment, for the production of a certain theme, the main color and the background color required in the theme can be customized by the user according to the own needs, for example, selecting "yellow" as the main color, selecting "black" as the background color, and so on, so that after the user directly inputs the main color and the background color, the user can obtain the corresponding main color and background color in the input message.
The second way is: acquiring a background image uploaded by a user aiming at the target material; the dominant and background colors in the background map are identified. In this embodiment, the background image is any picture uploaded by the user for the target material, and the main color and the background color can be identified in the background image according to the color distribution. Such as: the main color with less colors and more vivid colors can be identified in one picture according to the color distribution, and the background color with more color distribution and darkness and large piece can be identified. Thus, the user can recognize the main color and the background color only by uploading one background image.
202. The first target color value is determined on a first color level of the primary color and the second target color value is determined on a second color level of the background color by a preset color separation rule.
In this embodiment, the preset color separation rule is a rule for separating the primary color and the background color after the primary color and the background color are acquired.
It is understood that, as long as the primary color is obtained, the primary color can be separated into other colors of the same color system with different contrast ratios by the preset color separation rule, so that the first target color value of the primary color is determined on the first color scale of the primary color. For example: fig. 3 is a schematic diagram of a first gradation of a dominant color according to an embodiment of the application. As can be seen from fig. 3, when the color is "yellow", it can be seen that at least one color of the same color system as "yellow" is separated on the first color level, and different color numbers are used for identification, for example, if the number #ffc107 indicates yellow, the number #ffb300 indicates yellow that is slightly darker than the number #ffc107, the number #ffca28 indicates yellow that is slightly lighter than the number #ffc107, the number #ff6f00 indicates yellow brown, and the like, and in addition to the colors as illustrated in fig. 3, other yellow colors such as brown yellow may be included in the embodiment of the present application, and the present application is not particularly limited. In addition, it should be noted that, the color numbers described above are only different colors of the user identifier, and other identifiers with the identifying function may be used to distinguish the different colors in practical applications, which is not limited in the embodiment of the present application. The first target color value described above is actually a contrast WCAG value for the dominant color at the corresponding first color level, and each contrast WCAG value corresponds to one color, so that the corresponding color number can be invoked whenever the first target color value of the dominant color at the first color level is determined, i.e. the corresponding WCAG value is determined.
Similarly, the background color can be separated into other colors of the same color system with different contrast ratios by the preset color separation rule as long as the background color is obtained. Fig. 4 is a schematic diagram of a second color level of the background color provided in the embodiment of the application. As can be seen from fig. 4, when the "gray" is used as the background color, it can be seen that at least one color of the same color system as the "gray" is separated on the second color level, and different color numbers are used for identification, for example, the number #9e9e9E represents gray, the number #757575 identifies gray that is darker than the number #9e9e9E, the number # BDBDBD identifies gray that is lighter than the number #9e9e, the number #424242 identifies dark gray, the number #000000 identifies black, the number # ffff identifies white that has no gray, and other colors of the gray system such as heavy gray may be included in addition to the colors listed in fig. 4, which are not particularly limited in the present application. In addition, it should be noted that, the color numbers described above are only different colors of the user identifier, and other identifiers with the identifying function may be used to distinguish the different colors in practical applications, which is not limited in the embodiment of the present application. The second target color value described above is actually a contrast WCAG value for the background color on the corresponding second color level, and each contrast WCAG value corresponds to one color, so that the corresponding color number can be invoked only by determining the second target color value of the background color on the second color level, that is, determining the corresponding WCAG value.
Alternatively, in other embodiments, the determination of the target color value by the preset color separation rule may be determined by: determining a first gradation value of the primary color and a second gradation value of the background color; determining WCAG a value according to the first and second gradation values; judging whether the WCAG value falls into a preset WCAG interval or not; when the WCAG values fall into the preset WCAG interval, determining that the color value corresponding to the WCAG value is the first target color value on the first color level, and determining that the color value corresponding to the WCAG value is the second target color value on the second color level; when the WCAG values do not fall into the preset WCAG interval, determining a first color value and a second color value, wherein the first color value has the smallest color level distance between the color values corresponding to the preset WCAG interval on the first color level, and the second color value has the smallest color level distance between the color values corresponding to the preset WCAG interval on the second color level; determining the first color value as the first target color value and determining the second color value as the second target color value.
In this embodiment, the first tone value refers to a tone value of the obtained dominant color on the first tone, and the first tone value can indicate which tone position in the first tone the obtained dominant color is mainly located; similarly, the second gradation value refers to a gradation value of the acquired background color on the second gradation, by which it can be indicated at which gradation position in the second gradation the acquired background color is mainly located. Therefore, after determining the first gradation value of the primary color and the second gradation value of the background color, the first gradation value and the second gradation value may be compared, and in fact, the second gradation value and the first gradation value are made a quotient, so as to obtain a corresponding WCAG value.
The preset section of the preset network content accessibility guide (web content accessibility guidelines, WCAG) indicates that the theme produced by the color corresponding to the color value in the section is satisfactory, and the achieved theme effect is satisfactory to the user. Therefore, it is necessary to determine whether the calculated WCAG value falls within the preset WCAG interval, and if the WCAG value falls within the preset WCAG interval, the color value corresponding to the WCAG value on the first color level is directly used as the first target color value, and the color value corresponding to the WCAG value on the second color level is used as the second target color value. For example: assuming that the calculated WCAG value is 4.6 and the preset WCAG interval is (4.5,6), it is obvious that the calculated WCAG value falls within the preset WCAG interval, and if the color value of the WCAG value is 4.6, the color corresponding to the first color level is numbered #ffa000, and the color corresponding to the second color level is numbered #616161, the corresponding target color on each color level is easily obtained. It should be appreciated that WCAG is a barrier-free design specification defined on the web, and its concept of contrast is mainly used in embodiments of the present application.
In addition, if it is determined that WCAG values do not fall within the preset WCAG interval, a first color value closest to the color value corresponding to the preset WCAG interval may be determined on the first color level, and a second color value closest to the color value corresponding to the preset WCAG interval may be determined on the second color level; determining the first color value as the first target color value and determining the second color value as the second target color value.
In this embodiment, when it is determined that the WCAG value does not fall into the preset WCAG interval, it is necessary to determine the color value on each color level, that is, to traverse and find the color value closest to the color value of the preset WCAG interval on the whole first color level, so as to take the closest color value as the first target color value of the main color, and similarly traverse and find the color value closest to the color value of the preset WCAG interval on the whole second color level, so as to take the closest color value as the second target color value of the background color.
For example: assuming that the calculated WCAG value is 3 and the preset WCAG interval is (4.5,6), it is obvious that the calculated WCAG value does not fall into the preset WCAG interval, at this time, all color values need to be traversed and queried on the first color level, and the color level distances between all color values and the preset WCAG interval are compared, and the smaller the distance is, the more similar the color corresponding to the color value is to the color corresponding to the preset WCAG interval, and the more consistent with the color of the user manufacturing theme is. Therefore, if the color value with the smallest tone scale distance between the searched and preset WCAG sections is 4 in the first tone scale, the color value is 4 as the first color value, and the first color value is the first target color value. Similarly, it is still necessary to traverse and query all the color values on the second color level, compare the color level distances between all the color values and the preset WCAG interval, and if the color value with the minimum color level distance between the traversed and queried color level and the preset WCAG interval on the second color level is 4.2, the color value is 4.2 and the second color value is the second target color value.
Optionally, in other embodiments, determining the first gradation value of the primary color and the second gradation value of the background color includes: calculating a first color level position of the main color and a second color level position of the background color through a distance calculation formula; the first tone scale value is determined from the first tone scale position, and the second tone scale value is determined from the second tone scale position.
203. And determining a first target color according to the first target color value, determining a second target color according to the second target color value, wherein the first target color and the second target color are used for dyeing the target material, so that the dyed target material is manufactured into a theme pack.
In this embodiment, the target material may include, but is not limited to, text, icon, background, bubble, or button, which is not specifically limited in the embodiment of the present application. Since each color value corresponds to a color number, and each color number uniquely identifies a color, a first target color can be determined according to the first target color value, and a second target color can be determined according to the second target color value, so that after the corresponding first target color and second target color are obtained, the first target color and the second target color can be used for dyeing the target material described above, and the dyed target material is manufactured into a theme required by a user.
Optionally, in other embodiments, after determining a first target color from the first target color value and determining a second target color from the second target color value, the first target color and the second target color are used to dye the target material, the method further comprises: and browsing the target materials dyed based on the first target color and the second target color through a visual design tool.
In the embodiment, the target material after dyeing is browsed in real time through the visual design tool, so that the manufacture and the treatment of the theme are more integrated, and the manufacture cost is greatly reduced.
In the embodiment of the application, after the main color and the background color are obtained, the first target color value is determined on the first color level of the main color and the second target color value is determined on the second color level of the background color through the preset color separation rule, so that the first target color is determined according to the first target color value, the second target color is determined according to the second target color value, the target material can be dyed by utilizing the first target color and the second target color, even when massive materials are faced, the target color values of the main color and the background color on the respective color levels can be determined through the preset color separation rule, the target material can be dyed after the target color is obtained, the target material can be dyed only through the main color and the background color, the material does not need to be replaced manually, the manufacturing cost of the theme package is reduced, and the manufacturing efficiency is improved.
The foregoing description of the solution provided by the embodiments of the present application has been mainly presented in terms of a method. It should be understood that, in order to implement the above-described functions, hardware structures and/or software modules corresponding to the respective functions are included. Those of skill in the art will readily appreciate that the various illustrative modules and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the application can divide the functional modules of the device according to the method example, for example, each functional module can be divided corresponding to each function, and two or more functions can be integrated in one processing module. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present application, the division of the modules is schematic, which is merely a logic function division, and other division manners may be implemented in actual implementation.
Referring to fig. 5, fig. 5 is a schematic diagram showing an embodiment of a data processing apparatus 50 according to an embodiment of the present application, where the data processing apparatus 50 may include:
an acquisition unit 501 for acquiring a main color and a background color;
A first determining unit 502 configured to determine a first target color value on a first color level of the primary color acquired by the acquiring unit 501 and determine a second target color value on a second color level of the background color acquired by the acquiring unit by presetting a color separation rule;
a second determining unit 503, configured to determine a first target color according to the first target color value determined by the first determining unit 502, determine a second target color according to the second target color value determined by the first determining unit, and use the first target color and the second target color to dye the target material.
Optionally, referring to fig. 6 on the basis of the embodiment corresponding to fig. 5, another embodiment of the apparatus 50 for data processing provided by the embodiment of the present application is shown, where the first determining unit 502 includes:
A determining module 5021, configured to determine a first color scale value of a primary color and a second color scale value of a background color;
A determining module 5021, configured to determine WCAG values according to the first tone value and the second tone value;
A judging module 5022, configured to judge whether the WCAG value falls within a preset WCAG interval;
The determining module 5021 is configured to determine, when the determining module 5022 determines that the WCAG value falls within the preset WCAG interval, that a color value corresponding to the preset WCAG interval is a first target color value on the first color level, and that a color value corresponding to the preset WCAG interval is a second target color value on the second color level;
The determining module 5021 is configured to determine, when the determining module 5022 determines that the WCAG value does not fall into the preset WCAG interval, a first color value and a second color value, where a color scale distance between the first color value and a color value corresponding to the preset WCAG interval is the smallest, and a color scale distance between the second color value and a color value corresponding to the preset WCAG interval is the smallest.
The determining module 5021 is configured to determine the first color value as a first target color value and determine the second color value as a second target color value.
Optionally, on the basis of the embodiment corresponding to fig. 6, in another embodiment of the apparatus 50 for data processing provided by the embodiment of the present application, the determining module 5021 includes:
the calculating sub-module is used for calculating the first color level position of the main color and the second color level position of the background color through a distance calculation formula;
The determining submodule is used for determining a first tone scale value according to the first tone scale position and determining a second tone scale value according to the second tone scale position.
Optionally, on the basis of the above-mentioned alternative corresponding embodiment of one of fig. 5, fig. 6 and fig. 6, in another embodiment of the apparatus 50 for data processing provided by the embodiment of the present application, the obtaining unit 501 includes:
The first acquisition module is used for acquiring an input message, wherein the input message carries a user-defined main color and a background color.
Optionally, on the basis of the above-mentioned alternative corresponding embodiment of one of fig. 5, fig. 6 and fig. 6, in another embodiment of the apparatus 50 for data processing provided by the embodiment of the present application, the obtaining unit 501 includes:
the second acquisition module is used for acquiring a background image uploaded by a user aiming at the target material;
and the identification module is used for identifying the main color and the background color in the background image.
Optionally, on the basis of the embodiment corresponding to 5, in another embodiment of the data processing apparatus 50 provided in the embodiment of the present application, the data processing apparatus 50 may further include:
And the browsing unit is used for browsing the target materials dyed based on the first target color and the second target color through the visual design tool after determining the first target color according to the first target color value and determining the second target color according to the second target color value.
In the embodiment of the present application, after the main color and the background color are acquired by the acquisition unit 501, a first target color value is determined on a first color level of the main color and a second target color value is determined on a second color level of the background color by a preset color separation rule, so that the first target color is determined according to the first target color value, and the second target color is determined according to the second target color value, so that the target material can be dyed by using the first target color and the second target color, even when a huge amount of materials are faced, the target color values of the main color and the background color on the respective color levels can be determined by the preset color separation rule, and thus, the target material can be dyed after the target color is obtained, and the target material can be dyed only by the main color and the background color without manually replacing the material, thereby not only reducing the manufacturing cost, but also improving the manufacturing efficiency.
The apparatus 50 for data processing in the embodiment of the present application is described above in terms of modular functional entities, and the computer device in the embodiment of the present application is described below in terms of hardware processing. Fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application, where the computer device may include the above-described data processing apparatus 50, and the computer device may include at least one processor 701, a communication line 707, a memory 703, and at least one communication interface 704, where the computer device may have a large difference due to different configurations or performances.
The processor 701 may be a general purpose central processing unit (central processing unit, CPU), microprocessor, application-specific integrated circuit (server IC), or one or more integrated circuits for controlling the execution of the program of the present application.
Communication line 707 may include a pathway to transfer information between the aforementioned components.
Communication interface 704, uses any transceiver-like device for communicating with other devices or communication networks, such as ethernet, radio access network (radio access network, RAN), wireless local area network (wireless local area networks, WLAN), etc.
The memory 703 may be a read-only memory (ROM) or other type of static storage device that may store static information and instructions, a random access memory (random access memory, RAM) or other type of dynamic storage device that may store information and instructions, and the memory may be stand alone and coupled to the processor via a communications line 707. The memory may also be integrated with the processor.
The memory 703 is used for storing computer-executable instructions for executing the aspects of the present application, and is controlled by the processor 701 for execution. The processor 701 is configured to execute computer-executable instructions stored in the memory 703, thereby implementing the method for data processing provided in the above-described embodiment of the present application.
Alternatively, the computer-executable instructions in the embodiments of the present application may be referred to as application program codes, which are not particularly limited in the embodiments of the present application.
In a particular implementation, the computer device may include multiple processors, such as processor 701 and processor 702 in FIG. 7, as one embodiment. Each of these processors may be a single-core (single-CPU) processor or may be a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In a specific implementation, the computer device may also include an output device 705 and an input device 706, as one embodiment. The output device 705 communicates with the processor 701 and may display information in a variety of ways. The input device 706 is in communication with the processor 701 and may receive input from a user in a variety of ways. For example, the input device 706 may be a mouse, a touch screen device, a sensing device, or the like.
The computer apparatus may be a general-purpose device or a special-purpose device. In a specific implementation, the computer device may be a desktop, a laptop, a nas server, a wireless terminal apparatus, an embedded apparatus, or an apparatus having a similar structure as in fig. 7. The embodiments of the present application are not limited to the type of computer device.
In an embodiment of the present application, the processor 701 included in the computer device further has the following functions:
Acquiring a main color and a background color;
determining a first target color value on a first color level of the main color and determining a second target color value on a second color level of the background color through a preset color separation rule;
And determining a first target color according to the first target color value, determining a second target color according to the second target color value, wherein the first target color and the second target color are used for dyeing the target material.
In some embodiments of the application, the processor 701 may also be specifically configured to,
Determining a first color level value of the primary color and a second color level value of the background color;
determining WCAG a value according to the first gradation value and the second gradation value;
Judging whether WCAG values fall into a preset WCAG interval or not;
When WCAG values fall into a preset WCAG interval, determining a color value corresponding to the preset WCAG interval as a first target color value on a first color level, and determining a color value corresponding to the preset WCAG interval as a second target color value on a second color level;
When WCAG values do not fall into a preset WCAG interval, determining a first color value and a second color value, wherein the color scale distance between the first color value and the color value corresponding to the preset WCAG interval is minimum, and the color scale distance between the second color value and the color value corresponding to the preset WCAG interval is minimum.
The first color value is determined to be a first target color value and the second color value is determined to be a second target color value.
In an embodiment of the present application, the processor 701 included in the computer device further has the following functions:
calculating a first color level position of the main color and a second color level position of the background color through a distance calculation formula;
a first tone value is determined based on the first tone position, and a second tone value is determined based on the second tone position.
In an embodiment of the present application, the processor 701 included in the computer device further has the following functions:
And acquiring an input message, wherein the input message carries the user-defined main color and background color.
In an embodiment of the present application, the processor 701 included in the computer device further has the following functions:
Acquiring a background image uploaded by a user aiming at a target material;
The dominant and background colors in the background map are identified.
In an embodiment of the present application, the processor 701 included in the computer device further has the following functions: after determining a first target color according to the first target color value and determining a second target color according to the second target color value, the first target color and the second target color are used for dyeing the target material, and browsing the target material dyed based on the first target color and the second target color through a visual design tool.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of elements is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (15)

1.A method of data processing, comprising:
Acquiring a main color and a background color;
Determining a first gradation value of the primary color and a second gradation value of the background color;
obtaining WCAG values by making a quotient of the second color gradation value and the first color gradation value;
judging whether the WCAG value falls into a preset network content accessibility guide WCAG interval;
When the WCAG value falls into the preset WCAG interval, determining that the color value corresponding to the WCAG value is a first target color value on the first color level, and determining that the color value corresponding to the WCAG value is a second target color value on the second color level;
When the WCAG values do not fall into the preset WCAG interval, determining a first color value and a second color value, wherein the first color value has the smallest color level distance between the color values corresponding to the preset WCAG interval on the first color level, and the second color value has the smallest color level distance between the color values corresponding to the preset WCAG interval on the second color level;
Determining the first color value as a first target color value and the second color value as a second target color value;
And determining a first target color according to the first target color value, determining a second target color according to the second target color value, wherein the first target color and the second target color are used for dyeing target materials so that the dyed target materials are manufactured into theme packs.
2. The method of claim 1, wherein determining the first level value of the primary color and the second level value of the background color comprises:
Calculating a first color level position of the main color and a second color level position of the background color through a distance calculation formula;
the first tone scale value is determined from the first tone scale position, and the second tone scale value is determined from the second tone scale position.
3. The method according to claim 1 or 2, wherein acquiring the dominant color and the background color comprises:
and acquiring an input message, wherein the input message carries the user-defined main color and background color.
4. The method according to claim 1 or 2, wherein acquiring the dominant color and the background color comprises:
Acquiring a background image uploaded by a user aiming at the target material;
The dominant and background colors in the background map are identified.
5. The method of claim 1, wherein after determining a first target color from the first target color value and determining a second target color from the second target color value, the first target color and the second target color are used to dye the target material, the method further comprises:
And browsing the target materials dyed based on the first target color and the second target color through a visual design tool.
6. The method of claim 1, wherein the target material comprises text, an icon, a background, a bubble, or a button.
7. An apparatus for data processing, comprising:
an acquisition unit configured to acquire a main color and a background color;
A first determining unit configured to determine a first target color value on a first color level of the primary color acquired by the acquiring unit and determine a second target color value on a second color level of the background color acquired by the acquiring unit, by a preset color separation rule;
The second determining unit is used for determining a first target color according to the first target color value determined by the first determining unit, determining a second target color according to the second target color value determined by the first determining unit, and dyeing target materials by the first target color and the second target color so that the dyed target materials are manufactured into a theme pack;
Wherein the first determining unit includes:
a determining module, configured to determine a first gradation value of the primary color and a second gradation value of the background color; obtaining WCAG values by making a quotient of the second color gradation value and the first color gradation value;
The judging module is used for judging whether the WCAG values fall into a preset network content accessibility guide WCAG interval;
The determining module is configured to determine, when the WCAG values fall within the preset WCAG interval, that a color value corresponding to the WCAG value is a first target color value on the first color level, and that a color value corresponding to the WCAG value is a second target color value on the second color level;
The determining module is configured to determine, when the WCAG values do not fall within the preset WCAG interval, a first color value and a second color value, where a color scale distance between the first color value and a color value corresponding to the preset WCAG interval is the smallest, and a color scale distance between the second color value and a color value corresponding to the preset WCAG interval is the smallest; determining the first color value as a first target color value and determining the second color value as a second target color value.
8. The apparatus of claim 7, wherein the determining module comprises:
The calculating sub-module is used for calculating the first color level position of the main color and the second color level position of the background color through a distance calculation formula;
And the determining submodule is used for determining the first tone value according to the first tone position and determining the second tone value according to the second tone position.
9. The apparatus according to claim 7 or 8, wherein the acquisition unit comprises:
the first acquisition module is used for acquiring an input message, wherein the input message carries a user-defined main color and a background color.
10. The apparatus according to claim 7 or 8, wherein the acquisition unit comprises:
the second acquisition module is used for acquiring a background image uploaded by a user aiming at the target material;
And the identification module is used for identifying the main color and the background color in the background image.
11. The apparatus of claim 7, wherein the apparatus further comprises:
And the browsing unit is used for browsing the target materials after the target materials are dyed based on the first target color and the second target color through a visual design tool after determining the first target color according to the first target color value and determining the second target color according to the second target color value.
12. The apparatus of claim 7, wherein the target material comprises text, an icon, a background, a bubble, or a button.
13. A computer device, the computer device comprising: input/output (I/O) interfaces, a processor and memory,
Program instructions are stored in the memory;
the processor is configured to execute program instructions stored in a memory and to perform the method of any one of claims 1 to 6.
14. A computer readable storage medium comprising instructions which, when run on a computer device, cause the computer device to perform the method of any one of claims 1 to 6.
15. A computer program product comprising instructions which, when run on a computer device or processor, cause the computer or processor to perform the method of any of claims 1 to 6.
CN201911349746.2A 2019-12-24 2019-12-24 Data processing method and related device Active CN113032063B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911349746.2A CN113032063B (en) 2019-12-24 2019-12-24 Data processing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911349746.2A CN113032063B (en) 2019-12-24 2019-12-24 Data processing method and related device

Publications (2)

Publication Number Publication Date
CN113032063A CN113032063A (en) 2021-06-25
CN113032063B true CN113032063B (en) 2024-04-26

Family

ID=76452350

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911349746.2A Active CN113032063B (en) 2019-12-24 2019-12-24 Data processing method and related device

Country Status (1)

Country Link
CN (1) CN113032063B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113862963B (en) * 2021-09-07 2023-10-24 青岛海尔科技有限公司 Washing machine, control method and device thereof, storage medium and processor

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102035990A (en) * 2009-09-30 2011-04-27 株式会社日立制作所 Method of color customization of content screen
CN107016978A (en) * 2017-04-25 2017-08-04 腾讯科技(深圳)有限公司 A kind of showing interface technology and terminal device
CN109427036A (en) * 2017-08-22 2019-03-05 北京搜狗科技发展有限公司 The treating method and apparatus of skin color
CN110472083A (en) * 2018-05-08 2019-11-19 优酷网络技术(北京)有限公司 Colour gamut recommended method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102035990A (en) * 2009-09-30 2011-04-27 株式会社日立制作所 Method of color customization of content screen
CN107016978A (en) * 2017-04-25 2017-08-04 腾讯科技(深圳)有限公司 A kind of showing interface technology and terminal device
CN109427036A (en) * 2017-08-22 2019-03-05 北京搜狗科技发展有限公司 The treating method and apparatus of skin color
CN110472083A (en) * 2018-05-08 2019-11-19 优酷网络技术(北京)有限公司 Colour gamut recommended method and device

Also Published As

Publication number Publication date
CN113032063A (en) 2021-06-25

Similar Documents

Publication Publication Date Title
RU2645276C2 (en) Creation of variations when converting data to consumer content
US9514543B2 (en) Color name generation from images and color palettes
US9697573B1 (en) Color-related social networking recommendations using affiliated colors
WO2018198080A1 (en) Systems and methods of matching style attributes
CN105446592A (en) Application icon classification and displaying method and device
CN105005582A (en) Recommendation method and device for multimedia information
US11462002B2 (en) Wallpaper management method, apparatus, mobile terminal, and storage medium
CN103488569A (en) Method and device for testing performance of electronic equipment
US11714865B2 (en) Visual search refinement
CN107193440A (en) A kind of method for showing interface and device, computer installation and readable storage medium storing program for executing
CN109814971B (en) Desktop application icon arrangement method, electronic device and storage medium
CN106406900A (en) Wallpaper display method and device
CN104111769A (en) Method and device for displaying electronic folders
CN113032063B (en) Data processing method and related device
CN108304839A (en) A kind of image processing method and device
CN107391540A (en) A kind of small routine methods of exhibiting, device and grader
US10964288B2 (en) Automatically adapt user interface color scheme for digital images and video
CN106971004B (en) Search result providing method and device
CN105930149B (en) A kind of display methods and device
CN107203312A (en) Rendering intent, the storage device of mobile terminal and its picture
CN110363837A (en) The processing method and processing device of texture image, electronic equipment, storage medium in game
CN104572303B (en) Application resource management and calling device, method and application resource manage system
CN117112090A (en) Business page theme generation method, device, computer equipment, medium and product
CN111199138A (en) Method, system, server and storage medium for stroking bullet screen containing Emoji expression by using QML (QML)
CN112558853B (en) Session message processing method and device, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant