CN107479839B - Color wheel, two-color rendering method, color extracting method, readable storage medium and computer - Google Patents

Color wheel, two-color rendering method, color extracting method, readable storage medium and computer Download PDF

Info

Publication number
CN107479839B
CN107479839B CN201710528493.XA CN201710528493A CN107479839B CN 107479839 B CN107479839 B CN 107479839B CN 201710528493 A CN201710528493 A CN 201710528493A CN 107479839 B CN107479839 B CN 107479839B
Authority
CN
China
Prior art keywords
color
position point
increment
block
calculating
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
CN201710528493.XA
Other languages
Chinese (zh)
Other versions
CN107479839A (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.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics 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 Guangzhou Shiyuan Electronics Thecnology Co Ltd, Guangzhou Shirui Electronics Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201710528493.XA priority Critical patent/CN107479839B/en
Priority to PCT/CN2017/103772 priority patent/WO2019006892A1/en
Publication of CN107479839A publication Critical patent/CN107479839A/en
Application granted granted Critical
Publication of CN107479839B publication Critical patent/CN107479839B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1407General aspects irrespective of display type, e.g. determination of decimal point position, display with fixed or driving decimal point, suppression of non-significant zeros

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention provides a color wheel, a two-color rendering method, a color taking method, a readable storage medium and a computer, wherein the color wheel is provided with a color adjusting block, and the two-color rendering method comprises the following steps: when the toning block moves forwards on the color disc, acquiring a first color corresponding to the initial position of the toning block on the color disc and acquiring a second color selected by a user; traversing each position point of the moving track of the color adjusting block, and calculating the color increment of the first color changing to the second color according to the position increment of the moving of the color adjusting block so as to obtain the target color of the color adjusting block corresponding to each position point of the moving track; and drawing a circle by taking the current position point of the toning block as the center of the circle to form a circular area, and filling the circular area with the target color corresponding to the current position point. The color of the color wheel is changed between the first color and the second color by moving the color patch.

Description

Color wheel, two-color rendering method, color extracting method, readable storage medium and computer
Technical Field
The invention relates to the field of color processing, in particular to a color wheel, a two-color rendering method, a color extracting method, a readable storage medium and a computer.
Background
At present, the color of terminal devices such as computers and tablets is generally selected to control the color change of a display picture.
A plurality of colors are preset on the existing color disc, and a user only needs to select one of the colors on the color disc. However, existing color wheels exhibit limited colors, typically requiring the user to adjust either R, G, B values or H, S, L values to change the color. For users unfamiliar with R, G, B or H, S, L values of color, multiple attempts are made to obtain the desired color. The color adjustment mode is single, and the desired color cannot be obtained quickly.
Disclosure of Invention
In view of the above, it is desirable to provide a color wheel, a two-color rendering method, a color extracting method, a readable storage medium, and a computer, which solve the problem of low color extracting efficiency of the color wheel in the prior art.
The invention provides a two-color rendering method of a color wheel, wherein the color wheel is provided with a color adjusting block, and the two-color rendering method comprises the following steps:
when the toning block moves forwards on the color disc, acquiring a first color corresponding to the initial position of the toning block on the color disc and acquiring a second color selected by a user;
traversing each position point of the moving track of the color adjusting block, and calculating the color increment of the first color changing to the second color according to the position increment of the moving of the color adjusting block so as to obtain the target color of the color adjusting block corresponding to each position point of the moving track;
and drawing a circle by taking the current position point of the toning block as the center of the circle to form a circular area, and filling the circular area with the target color corresponding to the current position point.
The two-color rendering method may further include the step of calculating a color increment of the first color changing to the second color according to the position increment of the movement of the color matching block to obtain a target color corresponding to the color matching block at each position point of the movement track, where the target color corresponds to the position increment of the movement track, and the step of calculating the color increment of the first color changing to the second color according to the position increment of the movement of the color matching block:
calculating differences between R, G, B values of the first color and R, G, B values of the second color respectively to obtain R, G, B difference values;
calculating a position increment of the color adjusting block when the color adjusting block moves from the initial position to the current position point;
and calculating the ratio of the position increment to a preset position increment, and calculating R, G, B value of the target color corresponding to the current position point according to the ratio and the R, G, B differential value.
In the two-color rendering method, a calculation formula of the R, G, B value of the target color is:
when the delta D is less than or equal to D,
Figure BDA0001338895230000021
when Δ d>When the position D is in the range of D,
Figure BDA0001338895230000022
wherein r, g, b are eachR, G, B value, r, for the point corresponding color at the current location1、g1、b1R, G, B values, r, respectively, for the first color2、g2、b2R, G, B values for the second color, Δ r, Δ g, Δ b values for the R, G, B delta values, Δ D is the position increment when the key block moves from the initial position to the current position point, and D is the preset position increment.
The two-color rendering method described above, wherein, after the step of filling the circular area with the target color corresponding to the current location point, further includes:
and when the color adjusting block moves reversely, determining the color corresponding to the position point where the color adjusting block is located on the moving track, and filling the circular area corresponding to the position point where the color adjusting block is located with the corresponding color.
The two-color rendering method may further include the step of rotating around an origin of the color wheel when the color patch moves, and the step of calculating a position increment when the color patch moves from the initial position to the current position includes:
acquiring coordinates of each position point of the moving track of the color adjusting block, and acquiring a vector from the origin to the coordinates of each position point of the moving track;
and accumulating and calculating the included angle of adjacent vectors between the initial position and the current position point to obtain the position increment of the color adjusting block when the color adjusting block moves from the initial position to the current position point.
In the two-color rendering method, adjacent position points of the movement track of the color block are spaced by 1 °.
The two-color rendering method may further include the steps of drawing a circle with a current position point of the color tone block as a center of the circle to form a circular area, and filling the circular area with a target color corresponding to the current position point, including:
judging whether a corresponding circular area exists at the current position point of the color mixing block on the color disc;
if so, replacing the color of the circular area corresponding to the current position point with the target color;
if not, drawing a circle by taking the current position point as the center of the circle to form a circular area, and filling the circular area corresponding to the current position point with the target color.
The invention also provides a color sampling method, wherein the method is applied to the color disc and comprises the following steps:
when a click signal is acquired, determining the coordinate of a click position, and moving the color matching block to a position point corresponding to the coordinate on the color disc;
and selecting the color of the circular area of the position point corresponding to the coordinate on the color disc.
The invention also provides a color disc, wherein the color disc is provided with a color adjusting block, and the color disc comprises:
the color obtaining module is used for obtaining a first color corresponding to the initial position of the toning block on the color disc and obtaining a second color selected by a user when the toning block moves forwards on the color disc;
the calculation module is used for traversing each position point of the moving track of the color adjusting block, and calculating the color increment of the first color changing to the second color according to the position increment of the moving of the color adjusting block so as to obtain the target color of the color adjusting block corresponding to each position point of the moving track;
and the first filling module is used for drawing a circle by taking the current position point of the color mixing block as the center of the circle to form a circular area and filling the circular area with the target color corresponding to the current position point.
The color wheel, wherein the calculating block comprises:
the first calculation submodule is used for calculating the difference between the R, G, B value of the first color and the R, G, B value of the second color respectively to obtain a R, G, B difference value;
the second calculation submodule is used for calculating the position increment when the color adjusting block moves from the initial position to the current position point;
and the third calculation submodule is used for calculating the ratio of the position increment and a preset position increment and calculating R, G, B value of the target color according to the ratio and the R, G, B differential value.
The color wheel, wherein the R, G, B value of the target color is calculated by the formula:
when the delta D is less than or equal to D,
Figure BDA0001338895230000041
when Δ d>When the position D is in the range of D,
Figure BDA0001338895230000042
wherein r, g and b are R, G, B values of the corresponding color of the current position point respectively, and r1、g1、b1R, G, B values, r, respectively, for the first color2、g2、b2R, G, B values for the second color, Δ r, Δ g, Δ b values for the R, G, B delta values, Δ D is the position increment when the key block moves from the initial position to the current position point, and D is the preset position increment.
Above-mentioned color disc still includes:
and the second filling module is used for determining the color corresponding to the position point where the color matching block is located on the moving track when the color matching block moves reversely, and filling the circular area corresponding to the position point where the color matching block is located with the corresponding color.
The color wheel, wherein the color wheel rotates around the origin of the color wheel when the color matching block moves, and the second computing submodule includes:
the coordinate acquisition module is used for acquiring the coordinates of each position point of the moving track of the color adjusting block and obtaining the vector from the origin to the coordinates of each position point of the moving track;
and the angle calculation module is used for accumulatively calculating the included angle of the adjacent vectors between the initial position and the current position point so as to obtain the position increment when the color adjusting block moves from the initial position to the current position point.
Above-mentioned color disc still includes:
the signal acquisition module is used for determining the coordinate of a click position when a click signal is acquired, and moving the color matching block to a position point corresponding to the coordinate on the color disc;
and the color selection module is used for selecting the color of the circular area of the position point corresponding to the coordinate on the color disc.
The invention also provides a readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the above-mentioned method.
The invention also provides a computer comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method when executing the program.
In the embodiment of the invention, a user can use the color of the circular area at any position point where the color matching block is positioned as the first color, obtain the color selected by the user as the second color, and control the color of the color disc to change between the first color and the second color by moving the color matching block. The user can conveniently and automatically adjust the color to obtain the colorful color disc with the color change, and the desired color can be quickly obtained.
Drawings
Fig. 1 is a flowchart of a two-color rendering method in a first embodiment of the present invention;
FIG. 2 is a flowchart of a bi-color rendering method according to a second embodiment of the present invention;
FIG. 3 is a flowchart of a bi-color rendering method according to a third embodiment of the present invention;
FIG. 4 is a flow chart of a color sampling method according to a fourth embodiment of the present invention;
FIG. 5 is a block diagram of a color wheel according to a fifth embodiment of the present invention;
fig. 6 is a block diagram of a computing module in fig. 5.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
These and other aspects of embodiments of the invention will be apparent with reference to the following description and attached drawings. In the description and drawings, particular embodiments of the invention have been disclosed in detail as being indicative of some of the ways in which the principles of the embodiments of the invention may be practiced, but it is understood that the scope of the embodiments of the invention is not limited correspondingly. On the contrary, the embodiments of the invention include all changes, modifications and equivalents coming within the spirit and terms of the claims appended hereto.
Please refer to fig. 1, which is a method for dual-color rendering of a color wheel according to a first embodiment of the present invention, including steps S11-S13, where the color wheel is provided with a color wheel, and the color wheel is movable on the color wheel, for example, a user may drag the color wheel by dragging a mouse or touching a display screen.
Step S11, when the color matching block moves forward on the color wheel, acquiring a first color corresponding to the color matching block at the initial position of the color wheel and acquiring a second color selected by the user. The first color is the color corresponding to the starting position point when the color adjusting block moves on the color disc. A plurality of standard colors can be preset on the color wheel, and a user selects one color as a second color through a mouse or touch.
Step S12, traversing each position point of the movement trajectory of the toning block, and calculating a color increment of the first color changing to the second color according to the position increment of the movement of the toning block, so as to obtain a target color corresponding to each position point of the toning block on the movement trajectory.
And when the user moves the color adjusting block, calculating the color increment of the color change from the first color to the second color according to the position increment of the movement of the color adjusting block, wherein the color increment is the degree of the color change. For example, the position increment when the movement track of the toning block is completely changed from the first color to the second color is D, and the color increment of the color change from the first color to the second color is calculated according to the ratio of the position increment corresponding to the current position point of the movement track of the toning block to D, so as to obtain the target color corresponding to the current position point.
Step S13, drawing a circle with the current position point of the color matching block as the center of the circle to form a circular area, and filling the circular area with the target color corresponding to the current position point.
And after determining the target color corresponding to the current position point, drawing a circle by taking the current position point as a circle center to form a circular area, and filling the target color corresponding to the current position point in the circular area taking the current position point as the circle center. Traversing each position point of the moving track of the color adjusting block, and then rendering the moving track of the color adjusting block into a color band gradually changing from the first color to the second color. Thereby, a color between the first color and the second color is available from the rendered color wheel.
In this embodiment, the user may use the color of the circular area at any position point where the toner block is located as the first color, obtain the color selected by the user as the second color, and control the color of the color wheel to change between the first color and the second color by moving the toner block. The color is convenient for users to debug the color by themselves, and the color disc with colorful color changes is obtained.
Please refer to fig. 2, which is a color wheel according to a second embodiment of the present invention, wherein the color wheel is provided with a color adjusting block, and the color adjusting block can move on the color wheel, for example, a user can drag the color adjusting block by dragging a mouse or touching a display screen. The two-color rendering method of the color wheel comprises the steps of S21-S25.
Step S21, when the color matching block moves forward on the color wheel, acquiring a first color corresponding to the color matching block at the initial position of the color wheel and acquiring a second color selected by the user.
Step S22, calculating differences between R, G, B values of the first color and R, G, B values of the second color, respectively, to obtain a R, G, B difference value. The first color is the color displayed in the corresponding circular area when the color adjusting block is at the initial position of the moving track. R, G, B the difference values Δ r, Δ g, and Δ b are calculated as follows:
Δr=r2-r1
Δg=g2-g1
Δb=b2-b1
wherein r is1、g1、b1R, G, B values, r, respectively, for the first color2、g2、b2Respectively R, G, B values for the second color.
Step S23, traversing each position point of the movement trajectory of the dither block, and calculating a position increment when the dither block moves from the initial position to the current position point.
When the toning block moves on the color disc, a formed moving track comprises a plurality of uniformly arranged position points, and when the toning block moves to one position point, the position increment of the toning block when the toning block moves from the initial position to the current position point of the color disc is calculated.
Step S24, calculating a ratio between the position increment and a preset position increment, and calculating a R, G, B value of the target color corresponding to the current position point according to the ratio and the R, G, B difference value.
And step S25, drawing a circle by taking the current position point as the center of the circle to form a circular area, and filling the circular area with the target color corresponding to the current position point.
In the above step, R, G, B value of target color is calculated according to the ratio and R, G, B difference value, wherein R, G, B value of the target color changes along with position point at r1、g1、b1And r2、g2、b2To change between. And drawing a circle by taking the current position point of the toning block as the center of the circle, and filling the target color in the corresponding circular area to obtain the circular color area rendered by the target color. The method is used for rendering a circular area corresponding to one position point of the moving track of the color matching block to obtain a color area gradually changing from the first color to the second color.
Specifically, when the toner patch moves in the forward direction, the R, G, B value of the target color is calculated by the following formula:
when the delta D is less than or equal to D,
Figure BDA0001338895230000081
when Δ d>When the position D is in the range of D,
Figure BDA0001338895230000082
wherein r, g, b are R, G, B values of the target color, respectively1、g1、b1R, G, B values, r, respectively, for the first color2、g2、b2R, G, B values for the second color, Δ r, Δ g, Δ b values for the R, G, B delta values, Δ D is the position increment when the key block moves from the initial position to the current position point, and D is the preset position increment.
The color between the first color and the second color is determined according to the position increment Δ d of the movement of the toner patch. When the toning block moves forwards, delta d is larger than 0, the color displayed by the moving track of the toning block changes from the first color to the second color, and the second color is displayed in the circular area corresponding to the position point of the toning block until delta d is larger than or equal to the preset position increment.
In this embodiment, the color between the first color and the second color (including the first color and the second color) is calculated by the ratio of the position increment of the movement of the color patch to the preset position increment and the R, G, B value difference of the first color and the second color, and the calculated color is filled in the circular area with each position point as the center, so that the color area changing from the first color to the second color is formed on the color disc along with the movement of the color patch.
Referring to fig. 3, a bi-color rendering method according to a third embodiment of the present invention includes steps S31-S37. The color disc is provided with a color mixing block, the color disc and the color mixing block are both circular, the diameter of the color mixing block is equal to the radius of the color disc, the color mixing block is internally tangent with the color disc, and the color mixing block moves around the circle center of the color disc.
Step S31, when the color matching block moves forward on the color wheel, acquiring a first color corresponding to the color matching block at the initial position of the color wheel and acquiring a second color selected by the user.
Step S32, calculating differences between R, G, B values of the first color and R, G, B values of the second color, respectively, to obtain a R, G, B difference value.
Step S33, traversing each position point of the movement trajectory when the toning block moves in the forward direction, acquiring coordinates of each position point of the movement trajectory of the toning block, and obtaining a vector from the origin to the coordinates of each position point of the movement trajectory.
Step S34, calculating an included angle between adjacent vectors between the initial position and the current position point in an accumulated manner, so as to obtain a position increment when the color adjustment block moves from the initial position to the current position point.
Step S35, calculating a ratio of the position increment to a preset position increment, and calculating a R, G, B value of the target color according to the ratio and the R, G, B difference value.
Step S36, drawing a circle with the current position point of the color matching block as the center of the circle to form a circular area, and filling the circular area with the target color corresponding to the current position point. And when the circular area is filled with the target color, pixel point coloring is carried out on the circular area according to the R, G, B value of the target color point.
In the above step, the position increment of the movement of the toner patch is the angle of rotation, that is, the angle θ of rotation when the toner patch is moved from the initial position to the current position point is calculated. In the process of dragging the color matching blocks, the theta is traversed in a circulating mode, circles are drawn on the color matching disc by taking 1 degree as a unit, the size of the drawn circular area is the same as that of the color matching blocks, and the current color of the color matching disc is filled with the calculated target color at each angle as the area. The rotation angle of the drawn circle is: initiallangle +1, initiallangle +2, and initiallangle + θ, initially, initiallangle is 0, and the toning ball is centered on top of the palette.
In the above step, the step of drawing a circle with the current position point of the color-adjusting block as the center of the circle to form a circular area, and filling the circular area with the target color corresponding to the current position point includes:
step S361, determining whether the current position point on the color wheel has a corresponding circular area, if yes, performing step S362, otherwise, performing step S363.
Step S362, replacing the color of the circular area corresponding to the current location point with the target color.
Step S363, drawing a circle with the current position point as a center of the circle to form a circular area, and filling the circular area corresponding to the current position point with the target color.
In this embodiment, the color matching effect of the two colors is formed by stacking a large number of circles filling the current color of the color matching disc along the dragging direction. In the process of mass color matching, in order to avoid excessive increase of the system memory caused by frequent color matching, the following method is adopted to avoid the problem:
the color matching block can draw 360 circles at most when moving, namely, each degree on the color disc forms a circle with the same size as the color matching block, so that the color matching rendering effect is smooth and natural. Specifically, a dictionary is adopted to record a circle corresponding to the rotation angle, and in the rotation process, whether a circular area corresponding to the position exists or not is judged, and if not, the circle is added. If so, the previous circle is deleted and the target color filled circle is drawn. Of course, the color wheel may be initially set to fill a default color, such as black, and the target color is used to replace the color of the original circular area when the color palette is moved.
Step S37, when the toning block moves reversely, determining the color corresponding to the position point where the toning block is located on the moving track, and filling the circular area corresponding to the position point where the toning block is located with the corresponding color.
The process of gradually changing from the second color to the first color is the reverse process of the process of gradually changing from the first color to the second color, and the harmonic principle of the two colors is the same.
The preset position increment is, for example, 720 degrees, that is, the difference values of R, G, B color channels are divided into 720 parts, and the values of each part are Δ r/720, Δ g/720, and Δ b/720. When the color patch moves in the forward direction, i.e., rotates clockwise, the R, G, B value of the target color is calculated as:
when theta is less than or equal to 720 degrees,
Figure BDA0001338895230000101
when theta is>When the angle is 720 degrees, the angle is,
Figure BDA0001338895230000102
when the color mixing block moves from the current position point to the next position point counterclockwise, that is, from the second position point to the third position point, the R, G, B value of the color corresponding to the third position point is calculated by the formula:
when theta' is less than or equal to 0 and less than or equal to 720,
Figure BDA0001338895230000111
when theta' is less than or equal to 0 and more than or equal to 720,
Figure BDA0001338895230000112
when the theta' < -720 is present,
Figure BDA0001338895230000113
wherein r ', g', b 'are R, G, B values of the color corresponding to the third position point, θ is the angle of rotation when the color adjustment block moves from the initial position to the second position point, and θ' is the angle of counterclockwise movement from the second position point to the third position point, and is a negative value.
When the toning block moves forwards, the moving angle of the toning block is larger than 0, the color displayed by the moving track of the toning block is changed from the first color to the second color, and the second color is displayed in the circular area corresponding to the current position until the forward moving angle of the toning block is larger than or equal to 720 degrees; when the toning block moves reversely, the moving angle of the toning block is a negative value, the color filled in the moving track of the toning block changes from the second color to the first color, and the first color is filled in the circular area corresponding to the current position until the angle of the toning block moving reversely is larger than or equal to theta. If theta' is smaller than 720 degrees, the first color can be adjusted by rotating the color matching block counterclockwise by 720 degrees according to the calculation of 720 degrees.
In this embodiment, a circular color wheel is taken as an example to describe the method of two-color rendering in detail, and it can be understood that the shapes of the color wheel and the color block are not limited to a circle, but may also be rectangles or other shapes, and the position increment of the moving of the color block is calculated by the moving distance of the color block.
Referring to fig. 4, a fourth embodiment of the present invention further provides a color extraction method applied to the color wheel in the above embodiment, including steps S41 to S42:
step S41, when a click signal is acquired, determining the coordinate of a click position, and moving the color matching block to a position point corresponding to the coordinate on the color disc;
and step S42, selecting the color of the circular area corresponding to the position point corresponding to the coordinate on the color disc.
When any position point on the color disc is clicked by the mouse, the coordinate of the click position of the mouse is obtained, the color matching block is moved to the position point corresponding to the coordinate, and the color of the circular area of the position point corresponding to the coordinate is selected.
Taking a circular color wheel as an example, the color palette moves around the origin of the circular color wheel, which includes a color container containing 360 entries to record the color corresponding to each rotation angle. When the mouse is clicked, the position coordinate of the mouse is obtained, and a vector currentVector from the circle center of the palette to a click point is obtained. The angle β between the vector originvector and the vector currentVector at the initial position is calculated, and if β is negative, β is 360+ β. Finding the color corresponding to the beta in the color container to obtain the color of the click point. In this embodiment, the disc is provided with 360 position points in a unit of 1 °, and if the coordinate of the click position is located between two position points, the circular area corresponding to the click position is determined by determining which position point the click position falls within the defined range. The user can conveniently and quickly select the required color on the color disc.
Referring to fig. 5, a color wheel in a fifth embodiment of the present invention is shown, where the color wheel is provided with a color adjusting block, and the color wheel includes:
a color obtaining module 10, configured to obtain a first color corresponding to the palette at an initial position of the palette and obtain a second color selected by a user when the palette moves forward on the palette;
a calculating module 20, configured to traverse each position point of the moving track of the color adjusting block, and calculate, according to a position increment of the color adjusting block, a color increment of the first color changing to the second color, so as to obtain a target color corresponding to each position point of the moving track of the color adjusting block;
the first filling module 30 draws a circle with the current position point of the color-mixing block as the center of the circle to form a circular area, and fills the circular area with the target color corresponding to the current position point.
The present embodiment controls the color of the color wheel to change between the first color and the second color by moving the color patch. The color is convenient for users to debug the color by themselves, and the color disc with colorful color changes is obtained.
Further, as shown in fig. 6, the calculation module 20 includes:
the first calculating submodule 21 is used for calculating the difference value between the R, G, B value of the first color and the R, G, B value of the second color respectively to obtain a R, G, B difference value;
a second calculation submodule 22, configured to calculate a position increment when the patch block moves from the initial position to the current position point;
and the third calculation submodule 23 is used for calculating the ratio of the position increment and a preset position increment and calculating R, G, B value of the target color according to the ratio and the R, G, B differential value.
Further, the R, G, B value of the target color is calculated by the formula:
when the delta D is less than or equal to D,
Figure BDA0001338895230000131
when Δ d>When the position D is in the range of D,
Figure BDA0001338895230000132
wherein r, g, b are R, G, B values of the color corresponding to the second position, respectively1、g1、b1R, G, B values, r, respectively, for the first color2、g2、b2R, G, B values for the second color, Δ r, Δ g, Δ b values for the R, G, B delta values, Δ D is the position increment when the key block moves from the initial position to the current position point, and D is the preset position increment.
Further, the color wheel further comprises:
and the second filling module 40 is configured to determine a color corresponding to a position point where the color matching block is located on the moving track when the color matching block moves reversely, and fill a circular area corresponding to the position point where the color matching block is located with the corresponding color.
Further, the color palette rotates around the origin of the color wheel when moving, and the second computing submodule 22 includes:
the coordinate acquisition module is used for acquiring the coordinates of each position point of the moving track of the color adjusting block and obtaining the vector from the origin to the coordinates of each position point of the moving track;
and the angle calculation module is used for accumulatively calculating the included angle of the adjacent vectors between the initial position and the current position point so as to obtain the position increment when the color adjusting block moves from the initial position to the current position point.
Further, the color wheel further comprises:
the signal acquisition module 50 is configured to determine a coordinate of a click position when a click signal is acquired, and move the color matching block to a position point on the color palette corresponding to the coordinate;
and the color selection module 60 is configured to select a color of a circular area of a position point corresponding to the coordinate on the color wheel.
The present invention also provides a readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of any one of the methods of embodiments 1 through 4 above.
The present invention also provides a computer comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of any of the methods of embodiments 1 to 4 described above when executing the program.
Those skilled in the art will appreciate that all or part of the steps in the method for implementing the above embodiments may be implemented by a program instructing the relevant hardware. The program may be stored in a computer-readable storage medium. Which when executed comprises the steps of the method described above. The storage medium includes: ROM/RAM, magnetic disk, optical disk, etc.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (9)

1. A double-color rendering method of a color wheel is characterized in that a color adjusting block is arranged on the color wheel, and the double-color rendering method comprises the following steps:
when the toning block moves forwards on the color disc, acquiring a first color corresponding to the initial position of the toning block on the color disc and acquiring a second color selected by a user;
traversing each position point of the moving track of the color adjusting block, and calculating the color increment of the first color changing to the second color according to the position increment of the moving of the color adjusting block so as to obtain the target color of the color adjusting block corresponding to each position point of the moving track;
drawing a circle by taking the current position point of the toning block as the center of the circle to form a circular area, and filling the circular area with a target color corresponding to the current position point, wherein,
the step of calculating the color increment of the change from the first color to the second color according to the position increment of the movement of the color matching block to obtain the target color corresponding to each position point of the color matching block on the movement track comprises calculating the difference value of R, G, B values of the first color and R, G, B values of the second color respectively to obtain R, G, B difference value when the position increment is less than or equal to the preset position increment; calculating a position increment of the color adjusting block when the color adjusting block moves from the initial position to the current position point; calculating the ratio of the position increment to a preset position increment; respectively calculating products of the R, G, B difference values and the ratios to obtain R, G, B incremental values; and calculating the sum of the R, G, B value of the first color and the R, G, B increment value respectively to obtain a R, G, B value of the color corresponding to the current position point.
2. The bi-color rendering method of claim 1, wherein the R, G, B value of the target color is calculated by the formula:
when the delta D is less than or equal to D,
Figure FDA0002579142270000011
when Δ D > D, the amount of the catalyst,
Figure FDA0002579142270000012
wherein r, g and b are R, G, B values of the corresponding color of the current position point respectively, and r1、g1、b1R, G, B values, r, respectively, for the first color2、g2、b2R, G, B values for the second color, Δ r, Δ g, Δ b values for the R, G, B delta values, Δ d is the position increase of the toning block as it moves from the initial position to the current position pointAnd D is the preset position increment.
3. The bi-color rendering method of claim 1, wherein the step of filling the circular area with the target color corresponding to the current location point is further followed by:
and when the color adjusting block moves reversely, determining the color corresponding to the position point where the color adjusting block is located on the moving track, and filling the circular area corresponding to the position point where the color adjusting block is located with the corresponding color.
4. The bi-color rendering method of claim 1, wherein the palette rotates around an origin of the color wheel when moved, and the step of calculating a position increment at which the palette moves from the initial position to a current position point comprises:
acquiring coordinates of each position point of the moving track of the color adjusting block, and acquiring a vector from the origin to the coordinates of each position point of the moving track;
and accumulating and calculating the included angle of adjacent vectors between the initial position and the current position point to obtain the position increment of the color adjusting block when the color adjusting block moves from the initial position to the current position point.
5. The bi-color rendering method of claim 1, wherein the step of drawing a circle with a current location point of the color tone block as a center to form a circular area, and filling the circular area with a target color corresponding to the current location point comprises:
judging whether a corresponding circular area exists at the current position point of the color mixing block on the color disc;
if so, replacing the color of the circular area corresponding to the current position point with the target color;
if not, drawing a circle by taking the current position point as the center of the circle to form a circular area, and filling the circular area corresponding to the current position point with the target color.
6. A color sampling method applied to the color wheel of any one of claims 1 to 5, comprising:
when a click signal is acquired, determining the coordinate of a click position, and moving the color matching block to a position point corresponding to the coordinate on the color disc;
and selecting the color of the circular area of the position point corresponding to the coordinate on the color disc.
7. The utility model provides a color disc, its characterized in that is equipped with the color mixing piece on the color disc, the color disc includes:
the color obtaining module is used for obtaining a first color corresponding to the initial position of the toning block on the color disc and obtaining a second color selected by a user when the toning block moves forwards on the color disc;
the calculation module is used for traversing each position point of the moving track of the color adjusting block, and calculating the color increment of the first color changing to the second color according to the position increment of the moving of the color adjusting block so as to obtain the target color of the color adjusting block corresponding to each position point of the moving track;
a first filling module, which draws a circle by taking the current position point of the color mixing block as the center of the circle to form a circular area and fills the circular area with the target color corresponding to the current position point, wherein,
the calculation block comprises a first calculation submodule, a second calculation submodule and a third calculation submodule, the first calculation submodule is used for calculating the difference value between R, G, B values of a first color and R, G, B values of a second color respectively to obtain R, G, B difference value when the position increment is smaller than or equal to a preset position increment, the second calculation submodule is used for calculating the position increment when the color adjusting block moves from the initial position to the current position point, and the third calculation submodule is used for calculating the ratio of the position increment to the preset position increment; respectively calculating products of the R, G, B difference values and the ratios to obtain R, G, B incremental values; and calculating the sum of the R, G, B value of the first color and the R, G, B increment value respectively to obtain a R, G, B value of the color corresponding to the current position point.
8. A readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
9. A computer comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1 to 6 are implemented when the program is executed by the processor.
CN201710528493.XA 2017-07-01 2017-07-01 Color wheel, two-color rendering method, color extracting method, readable storage medium and computer Active CN107479839B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710528493.XA CN107479839B (en) 2017-07-01 2017-07-01 Color wheel, two-color rendering method, color extracting method, readable storage medium and computer
PCT/CN2017/103772 WO2019006892A1 (en) 2017-07-01 2017-09-27 Palette, two-color rendering method, color acquisition method, readable storage medium, and computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710528493.XA CN107479839B (en) 2017-07-01 2017-07-01 Color wheel, two-color rendering method, color extracting method, readable storage medium and computer

Publications (2)

Publication Number Publication Date
CN107479839A CN107479839A (en) 2017-12-15
CN107479839B true CN107479839B (en) 2020-11-03

Family

ID=60595336

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710528493.XA Active CN107479839B (en) 2017-07-01 2017-07-01 Color wheel, two-color rendering method, color extracting method, readable storage medium and computer

Country Status (2)

Country Link
CN (1) CN107479839B (en)
WO (1) WO2019006892A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113238598B (en) * 2021-04-30 2022-05-06 深圳市爱图仕影像器材有限公司 Lighting device color matching method and device and storage medium
CN113133152B (en) * 2021-04-30 2023-01-24 深圳市爱图仕影像器材有限公司 Lighting device color matching method and device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101321228A (en) * 2007-06-06 2008-12-10 富士施乐株式会社 Color adjustment apparatus, computer-readable medium and color adjustment method
CN102541485A (en) * 2010-10-13 2012-07-04 普驰信息技术有限公司 Color selection graphical user interface
CN105630287A (en) * 2015-12-21 2016-06-01 天脉聚源(北京)教育科技有限公司 Color acquisition method and apparatus
CN105657391A (en) * 2016-01-04 2016-06-08 京东方科技集团股份有限公司 Image processing method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8860748B2 (en) * 2005-10-03 2014-10-14 Gary Lynn Campbell Computerized, personal-color analysis system
US20110292069A1 (en) * 2010-05-28 2011-12-01 Witt David Joseph RGB Color Mixer

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101321228A (en) * 2007-06-06 2008-12-10 富士施乐株式会社 Color adjustment apparatus, computer-readable medium and color adjustment method
CN102541485A (en) * 2010-10-13 2012-07-04 普驰信息技术有限公司 Color selection graphical user interface
CN105630287A (en) * 2015-12-21 2016-06-01 天脉聚源(北京)教育科技有限公司 Color acquisition method and apparatus
CN105657391A (en) * 2016-01-04 2016-06-08 京东方科技集团股份有限公司 Image processing method and device

Also Published As

Publication number Publication date
WO2019006892A1 (en) 2019-01-10
CN107479839A (en) 2017-12-15

Similar Documents

Publication Publication Date Title
CN103177440B (en) The system and method for synthetic image depth map
CN107479839B (en) Color wheel, two-color rendering method, color extracting method, readable storage medium and computer
US9508118B2 (en) Method and apparatus for processing image
US8468465B2 (en) Two-dimensional slider control
US5119439A (en) Method of and apparatus for extracting image contour data
US20150109323A1 (en) Interactive black and white image editing
US8599262B2 (en) IR camera with improved parameter interpretation and image control
US9563972B2 (en) Methods and apparatus for providing color palette management within a graphical user interface
CN106251322B (en) Image processing equipment, image processing method and image processing system
CN108762601A (en) Display methods, device and the mobile terminal of application function
CN106293328A (en) Icon display method and device
US20190096031A1 (en) Image interpolation methods and related image interpolation devices thereof
US9620086B1 (en) Dynamic contrast adjustments for glyph rendering
US9910512B1 (en) Systems and methods for using cursor movement profiles
EP2815297B1 (en) Cursor control for a visual user interface
CN104317398A (en) Gesture control method, wearable equipment and electronic equipment
CN105808230A (en) Method and device for moving suspension icon
CN107050859B (en) Unity 3D-based method for dragging camera to displace in scene
US9659228B2 (en) Image processing apparatus, image processing system, non-transitory computer readable medium, and image processing method
US10168880B2 (en) System, method and computer-accessible medium for manipulating a plurality of components using a single gesture or motion
CN111951349B (en) Method and device for adjusting graph vertex types and electronic equipment
CN107450873B (en) Color wheel, color matching method, readable storage medium and computer device
CN115445206A (en) Terrain editing method, terrain editing device, terrain editing terminal and storage medium
CN108664309A (en) A kind of long method for exhibiting data and system based on Android terminal
US20100328523A1 (en) Method of luminance compensation for a camera lens using multiline interpolation

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