CN103544004B - A kind of icon background color tone adjusting method and terminal based on colour circle - Google Patents

A kind of icon background color tone adjusting method and terminal based on colour circle Download PDF

Info

Publication number
CN103544004B
CN103544004B CN201310330761.9A CN201310330761A CN103544004B CN 103544004 B CN103544004 B CN 103544004B CN 201310330761 A CN201310330761 A CN 201310330761A CN 103544004 B CN103544004 B CN 103544004B
Authority
CN
China
Prior art keywords
angle
color
rgb value
rgb
colour circle
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.)
Expired - Fee Related
Application number
CN201310330761.9A
Other languages
Chinese (zh)
Other versions
CN103544004A (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.)
TCL Corp
Original Assignee
TCL Corp
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 TCL Corp filed Critical TCL Corp
Priority to CN201310330761.9A priority Critical patent/CN103544004B/en
Publication of CN103544004A publication Critical patent/CN103544004A/en
Application granted granted Critical
Publication of CN103544004B publication Critical patent/CN103544004B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)

Abstract

The invention discloses a kind of icon background color tone adjusting method based on colour circle and terminal, methods described includes:The angular transition of colour circle is pre-set into the first corresponding relation of rgb value and the second corresponding relation that rgb value is converted into the angle of colour circle is set;The color of icon is detected, is gray-scale map by icon transformation, calculate the proportion of the corresponding gray value of shades of colour;The rgb value of the corresponding color of gray value that acquisition accounts for the largest percentage, the second corresponding relation that the angle of colour circle is converted into according to rgb value calculates the corresponding angle of the color, and the angle is rotated into 180 ° of angles for obtaining the complementary color of the color;Angular transition according to colour circle calculates the corresponding rgb value of angle of complementary color into the first corresponding relation of rgb value, and the background colour of icon is changed to the color of complementary color.The present invention is adjusted using the trichromatic colour circles of RGB to Icon Color, improves the accuracy of color-match, makes icon more natural with the collocation of its background colour.

Description

A kind of icon background color tone adjusting method and terminal based on colour circle
Technical field
The present invention relates to terminal UI designs, more particularly to a kind of icon background color tone adjusting method and terminal based on colour circle.
Background technology
UI(User Interface, user interface), also referred to as man-machine interface refers to user and some system sides of interacting The set of method, it is intelligent television, smart mobile phone and Window, the indispensable indispensable part of (SuSE) Linux OS.Eventually The Software for Design at end can be divided into code Design and be designed with UI.UI designs refer to man-machine interaction, operation logic, the interface U.S. to software The global design of sight.Good UI designs can not only allow the software to become have individual character to have good taste, and the operation of software can also be allowed to become Comfortably, simply, freely, the positioning and feature of software are fully demonstrated.One UI attractive in appearance can bring comfortable vision to enjoy to user Receive, therefore, one of topmost design is collocation of colour in UI designs, and the colour match of good icon Yu background makes differentiation effect Become apparent from, be easy to user to search.
Existing software company often notices that the color of application icon is formulated, but designs often quilt for application icon background colour Ignore.For example, in the UI interfaces based on the systems of Windows 8, due to application icon color shape Shi Gejia software companys from What oneself exploitation was customized, do not consider the setting of icon background colour, icon there is a problem of not being adapted to the scheme of colour of its background, As shown in Figure 1:The Icon Color 102 of game is that raw meat is red, and its background color 101 is dark green;The Icon Color 402 of video is green Color, its background color 402 is dark red.Although red belong to contrast colour system with green, both colour match can highlight effect.But Be, the raw meat in Fig. 1 it is red with it is dark green, dark red is not most suitable contrastive colours with green combination;Cause the color matching of game application Effect is brighter, and the color matching effect of Video Applications is than dark.The Icon Color 202 of camera is that shallow pearl is red, its background colour 201 It is purple, both colors have an identical colour system, and purple is more causes icon to show not to protrude.The Icon Color of music 302 be it is middle blue purple, its background colour 301 be it is orange red, it is brighter and many based on orange red color, cause icon shape partial distortion, show It is unclear.
Thus prior art could be improved and improve.
The content of the invention
In view of above-mentioned the deficiencies in the prior art part, it is an object of the invention to provide a kind of icon background based on colour circle Tone adjusting method and terminal, cannot ensure confidential information not to solve prior art implementation information safeguard protection from software view The problem that can be revealed.
In order to achieve the above object, this invention takes following technical scheme:
A kind of icon background color tone adjusting method based on colour circle, it includes:
A, the angular transition of setting colour circle are converted into the angle of colour circle into first corresponding relation and setting rgb value of rgb value Second corresponding relation of degree;
The color of B, detection icon, is gray-scale map by icon transformation, calculates the proportion of the corresponding gray value of shades of colour;
The rgb value of the corresponding color of gray value that C, acquisition account for the largest percentage, the angle of colour circle is converted into according to rgb value The second corresponding relation calculate the corresponding angle of the color, by 180 ° of angles of the complementary color for obtaining the color of angle rotation;
D, the corresponding rgb value of angle for calculating complementary color into the first corresponding relation of rgb value according to the angular transition of colour circle, The background colour of icon is changed to the color of complementary color.
In the described icon background color tone adjusting method based on colour circle, also include after the step C:With the benefit In preset range on the basis of the angle of color, set angle of the angle as the complementary color is obtained at random;
In the step D, the angular transition according to colour circle calculates set angle pair into the first corresponding relation of rgb value The rgb value answered, the background colour of icon is changed to the color of the corresponding complementary color of set angle.
In the described icon background color tone adjusting method based on colour circle, the preset range on the basis of the angle of the complementary color is The angle of complementary color22.5°。
In the described icon background color tone adjusting method based on colour circle, the angle to colour circle was also included before the step A Degree initialization, specifically includes:
A01,360 ° of colour circle is divided into Zone R, G areas, B areas, each region accounts for 120 °;
A02, the start angle of definition Zone R are 0 °, and call number is 0, and rgb value is(1.0、0.0、0.0);Define rising for G areas Beginning angle is 120 °, and call number is 1, and rgb value is(0.0、1.0、0.0);The start angle for defining B areas is 240 °, and call number is 2, rgb value is(0.0、0.0、1.0);
A03, by the angled index corresponding table of three content creatings in area for defining and store.
In the described icon background color tone adjusting method based on colour circle, in the step A, the angular transition of the colour circle The first corresponding relation into rgb value includes:
A1, rgb value is initialized as(0.0、0.0、0.0);
A2, the corresponding area of acquisition current angular, and corresponding call number;The angle is calculated according to the area and call number Rgb value.
In the described icon background color tone adjusting method based on colour circle, the step A2 is specifically included:
Business is done the computing of mould 3 and obtains corresponding first call number of the angle by A21, calculating current angular divided by 120 business; The corresponding area of current angular is obtained according to the first call number, and is entered as the respective component in rgb value according to the first call number 1.0;
A22, calculating current angular compare remainder and 60 size divided by 120 remainder;When remainder is more than or equal to 60 When, the computing of mould 3 is done after adding 1 by the first call number and obtains the second call number, perform step A23;When remainder is less than 60, step is performed Rapid A24;
A23, the respective component in rgb value is entered as 1.0 according to the second call number;The corresponding rgb value of first call number Respective component be changed to, wherein, x represent current angular divided by 120 remainder;
Respective component in A4, the corresponding rgb value of the first call number is changed to, wherein, x represents that current angular is removed With 120 remainder.
In the described icon background color tone adjusting method based on colour circle, in the step A, the rgb value changes quality Second corresponding relation of the angle of ring includes:
A10, to rgb value in three components sorted by numerical values recited and mark its corresponding call number respectively;By RGB Value does normalized and obtains normalizing rgb value;
A20, off-center angle is calculated according to normalization rgb value, start angle is calculated according to call number and angle is judged The positive negative sense of deviation, according to off-center angle, start angle, deviate the angle that positive negative sense calculates colour circle.
In the described icon background color tone adjusting method based on colour circle, the step A10 is specifically included:
A101, compare three numerical values reciteds of component in rgb value, the corresponding rope of record variable index_max=largest components Quotation marks, the corresponding call number of variable i ndex_scend=Middle Components, the corresponding index of variable i ndex_third=minimum components Number;
A102, the value that the value of three components in rgb value is respectively divided by largest component, obtain normalizing rgb value.
In the described icon background color tone adjusting method based on colour circle, the step A20 is specifically included:
A201, off-center angle W is calculated, formula is:
W=(RGB/[scend]—RGB/[third])* step, step=60/r, r=1-RGB/ [third];Wherein, Step represents mapping step-length, and r represents mapping radius, and RGB/ [third] represents the numerical value of the minimum component in normalization rgb value; RGB/ [scend] represents the numerical value of the Middle Component in normalization rgb value;
A202, the corresponding start angle start of query interface index_max in angle index corresponding table;
Whether A203, judgment variable index_scend are equal to value that is after variable i ndex_max adds 1 and doing the computing of mould 3: If it is, the positive negative sense sign of the deviation of angle is 1;If it is not, then the positive negative sense sign of the deviation of angle is -1;
A204, the angle W_last for calculating final colour circle, formula is:W_last=start+sign*W.
A kind of terminal for realizing the described icon background color tone adjusting method based on colour circle, it includes:
Conversion setup module, for pre-setting first corresponding relation and setting of the angular transition of colour circle into rgb value Rgb value is converted into the second corresponding relation of the angle of colour circle;
Gradation processing module, icon transformation is gray-scale map by the color for detecting icon, calculates shades of colour corresponding The proportion of gray value;
Color angle processing module, the rgb value of the corresponding color of gray value on the one hand being accounted for the largest percentage for acquisition, The second corresponding relation that the angle of colour circle is converted into according to rgb value calculates the corresponding angle of the color, by angle rotation 180 ° of angles of the complementary color for obtaining the color;On the other hand it is used to be closed into the first correspondence of rgb value according to the angular transition of colour circle System calculates the corresponding rgb value of angle of complementary color;
Color adjustment module, the corresponding rgb value of angle of the complementary color for being calculated according to color angle processing module, The background colour of icon is changed to the color of complementary color.
Compared to prior art, icon background color tone adjusting method based on colour circle and terminal that the present invention is provided, according to figure Target gray-scale map obtains the rgb value of domain color, and the second corresponding relation that the angle of colour circle is converted into according to rgb value calculates main face The angle of the corresponding colour circle of color, 180 ° of angles of acquisition complementary color are rotated by the angle;Further according to colour circle angular transition into rgb value The first corresponding relation calculate the corresponding rgb value of angle of complementary color, the background colour of icon is changed to the color of complementary color;Due to Employ the trichromatic colour circles of RGB to be adjusted Icon Color, improve the accuracy of color-match, icon is carried on the back with it The collocation of scenery is more natural, increased the visual comfort at UI interfaces.
Brief description of the drawings
Fig. 1 is the scheme of colour of the existing icon based on the systems of Windows 8 and its background.
Fig. 2 is the color composition schematic diagram of existing light source colour, object color, hue circle.
Fig. 3 is the trichromatic colour circle schematic diagrames of RGB of icon background color tone adjusting method of the present invention based on colour circle.
Fig. 4 is icon background color tone adjusting method flow chart of the present invention based on colour circle.
Fig. 5 be the present invention based on colour circle icon background color tone adjusting method in icon transformation into gray-scale map schematic diagram.
Fig. 6 is the structured flowchart of the terminal that icon background colour of the present invention based on colour circle is adjusted.
Specific embodiment
The present invention provides a kind of icon background color tone adjusting method and terminal based on colour circle, to make the purpose of the present invention, skill Art scheme and effect are clearer, clear and definite, and the present invention is described in more detail for the embodiment that develops simultaneously referring to the drawings.Should manage Solution, specific embodiment described herein is only used to explain the present invention, is not intended to limit the present invention.
Please refer to Fig. 1 and Fig. 2, the species of color is broadly divided into light source colour and object color.The three primary colors of light source colour(Color Light)It is red, green, blue, it mixes two-by-two can obtain brighter Neutral colour, three kinds of equivalent combinations can then obtain white.Complementary color Finger is entirely free of another color, such as red and green mixing yellowly, because being entirely free of blueness, yellow is exactly blue benefit Color.The three primary colors of object color are fuchsins(Magenta)/ pinkish red, yellow (Yellow) and cyan (Cyan)/indigo plant, it mixes two-by-two The Neutral colour for obtaining is dark, and three kinds of equivalent combinations obtain black.White light contains all of perceived color, it is seen that light region It is by the purple infinite spectral composition to red.For the ease of color using collocation, simplifying displaying with circular fashion can See the color in light region, i.e. hue circle.20 hue circles are shown in Fig. 2, that includes red, yellow, primary colors, Yi Jiyou The secondary colours that primary colors mixing is produced such as purple, Huang Hong, green, remaining color is the tertiary colo(u)r(s) that the secondary mixture of colours mixes generation with primary colors. Although hue circle can show multiple color and its match mode, the quantity of its color is still restricted.
Primaries show the display screen for being usually used in electronic equipment.The RGB component distribution one of each pixel in RGB image Intensity level in the range of individual 0 ~ 255.RGB image only uses three kinds of colors, so that it may so that they mix according to different ratios, 16777216 (* 256 of 256 * 256) are reappeared on screen and plants color, the trichromatic colour circle of RGB as shown in Figure 3.The present invention is It is that icon background colour is automatically adjusted using RGB trichromatic colour circles;By a kind of face on colour circle angular, i.e. colour circle Color one colour circle angle of correspondence;The domain color of icon is detected, the rgb value of domain color is obtained and is converted into the angle on colour circle Degree, 180 ° of angles of the complementary color of acquisition domain color are rotated by angle, then by the angular transition of complementary color into rgb value, so as to obtain master The complementary color of color, the adjust automatically matching of color is realized using complementary color as icon background colour.Increased greatly by the way of colour circle Added can matching color diversity, improve the precision of color-match, make collocation of colour more natural, visual comfort is more It is high.
Please refer to Fig. 3 and Fig. 4, the icon background color tone adjusting method based on colour circle includes:
S100, the angular transition of colour circle is pre-set into the first corresponding relation of rgb value and rgb value is set is converted into Second corresponding relation of the angle of colour circle;
The color of S200, detection icon, is gray-scale map by icon transformation, calculates the ratio of the corresponding gray value of shades of colour Weight;
The rgb value of the corresponding color of gray value that S300, acquisition account for the largest percentage, colour circle is converted into according to rgb value Second corresponding relation of angle calculates the corresponding angle of the color, and the angle is rotated into 180 ° of angles for obtaining the complementary color of the color Degree;
S400, the corresponding RGB of angle for calculating complementary color into the first corresponding relation of rgb value according to the angular transition of colour circle Value, the background colour of icon is changed to the color of complementary color.
The trichromatic colour circles of RGB as one 360 ° of circle, are set each angle a kind of face of correspondence on circle by the present invention Color.In order to realize the mutual conversion between rgb value and the angle of colour circle, angle, color are first carried out to colour circle and is divided.Need note Meaning, is in a counterclockwise direction the yawing moment of angle in Fig. 3 in the present embodiment, i.e., on the basis of 0 °, rotate counterclockwise The angle of acquisition is for just, the angle of the acquisition that turns clockwise is negative.Also included before step S100 initial to the angle of colour circle Change, specifically include:
Step 01,360 ° of colour circle is divided into Zone R, G areas, B areas, each region accounts for 120 °;
Step 02, the start angle of definition Zone R are 0 °, and call number is 0, and rgb value is(1.0、0.0、0.0);Define G areas Start angle is 120 °, and call number is 1, and rgb value is(0.0、1.0、0.0);The start angle for defining B areas is 240 °, call number It is 2, rgb value is(0.0、0.0、1.0);
Step 03, by the angled index corresponding table of three content creatings in area for defining and store.
The present embodiment is according to R(It is red)、G(It is green)、B(It is blue)These three reference colours, are divided into three areas, as shown in Figure 3 by colour circle: Zone R is the red part to green, and 0 ° represents red;G areas are green to blue part, and 120 ° represent green;B areas are blueness To red part, 240 ° represent blue.The angle index corresponding table is as follows:
Define the conversion regime that angle and rgb value can be set after the angular divisions of colour circle.In the step S100, The angular transition of the colour circle includes into the first corresponding relation of rgb value:
Step 1, rgb value is initialized as(0.0、0.0、0.0);
Step 2, the corresponding area of acquisition current angular, and corresponding call number;Being calculated according to the area and call number should The rgb value of angle.
Rgb value is made up of tri- components of R, G, B, and its numerical value presentation format is RGB(x1、x2、x3), x1 represents R component Value, x2 represents the value of G components, and x3 represents the value of B component.The present embodiment first finds out current angular location;Based on area Size is 120 °, in area again on the basis of 60 °, the position where further reducing angle;Finally calculate the RGB of the angle Value.Then the step 2 is specifically included:
Business is done the computing of mould 3 and obtains corresponding first index of the angle by step 21, calculating current angular divided by 120 business Number;The corresponding area of current angular is obtained according to the first call number, and according to the first call number by the respective component assignment in rgb value It is 1.0.
Current angular can be found out which area is angle belong to divided by 120 in this step.Looked into after calculating the first call number Angle index corresponding table is the initial RGB values that can obtain angle.Such as, it is assumed that the first call number is 0, inquiry angle index corresponding table Learn that angle belongs to Zone R, the R component in rgb value is 1.0, initial RGB values are then(1.0、0.0、0.0).
Step 22, calculating current angular compare remainder and 60 size divided by 120 remainder;When remainder is more than or equal to When 60, the computing of mould 3 is done after adding 1 by the first call number and obtains the second call number, perform step 23;When remainder is less than 60, perform Step 24.
Remainder in this step is used to further determine that in the area, and angle is closer to which adjacent region.
Step 23, the respective component in rgb value is entered as 1.0 according to the second call number;The corresponding RGB of first call number The respective component of value is changed to, wherein, x represent current angular divided by 120 remainder.
Respective component in step 24, the corresponding rgb value of the first call number is changed to, wherein, x is represented and is worked as anterior angle Spend the remainder divided by 120.
So that current angular is 182 ° as an example, the angular transition of the colour circle is specifically calculated into the first corresponding relation of rgb value It is as follows:
1、182/120=1(Take business);1%3=1(The computing of mould 3), then the first call number is 1;Angle index corresponding table is looked into learn Current angular is in G(It is green)Area, is designated as 1.0, then initial RGB values by the value of G components in rgb value(0.0、1.0、0.0).
2、182%120=62(Take the remainder), because 62>60, the second call number=(First call number+1)%3=2%3=2, looks into angle Degree index corresponding table learns that the second call number belongs to B(It is blue)Area, 1.0 are designated as by the value of the B component in initial RGB values.
3rd, the value of G components is changed to 1-(62-60)/60=1-0.033=0.97(Approximate calculation).Then final RGB It is worth and is(0.0、0.97、1.0).
In the specific implementation, the angular transition of colour circle is realized into the first corresponding relation of rgb value using following program codes:
RGB[0] = RGB[1]=RGB[2] =0.0f;// initial interrogation form
Index = (angle / 120)% 3;// by angle map to three RGB color subregions,
RGB[index] = 1.0f;// the value that will be mapped to color subregion carries out color initialization
Remainder = angle % 120;// in the color subregion, it is determined that in the angle of the subregion
If Remainder > 60 , RGB[(index+1)%3] -= (Remainder-60)/60.0f;// be more than 60 degree of carrying out is processed;
If Remainder <60, RGB[index] -= Remainder/60.0f.// the carrying out less than 60 degree is located Reason
In the step S100, the second corresponding relation that the rgb value is converted into the angle of colour circle includes:
Step 10, to rgb value in three components sorted by numerical values recited and mark its corresponding call number respectively;Will Rgb value does normalized and obtains normalizing rgb value;
Step 20, off-center angle is calculated according to normalization rgb value, start angle is calculated according to call number and angle is judged The positive negative sense of deviation of degree, according to off-center angle, start angle, deviates the angle that positive negative sense calculates colour circle.
Based on there is three components in rgb value, the present embodiment by rgb value conversion it is angled when, first find out between component value Magnitude relationship, component value is bigger, illustrates the color closer to the component.Then normalized is done to rgb value, is normalized Rgb value, with normalize rgb value component size be calculate basis, calculate respectively its mapping radius, mapping step-length, deviate in Heart angle, the positive negative sense of deviation, finally obtain final angle.
Wherein, the step 10 is specifically included:
Step 101, compare three numerical values reciteds of component in rgb value, record variable index_max=largest components correspondence Call number, the corresponding call number of variable i ndex_scend=Middle Components, variable i ndex_third=minimum component it is corresponding Call number;
Step 102, the value that the value of three components in rgb value is respectively divided by largest component, obtain normalizing rgb value.
The step 20 is specifically included:
Step 201, off-center angle W is calculated, formula is:
W=(RGB/[scend]—RGB/[third])* step, step=60/r, r=1-RGB/[third];Wherein, Step represents mapping step-length, and r represents mapping radius, RGB/[third] represents the numerical value of the minimum component in normalization rgb value; RGB/[scend] represents the numerical value of the Middle Component in normalization rgb value;
Step 202, the corresponding start angle start of query interface index_max in angle index corresponding table;
Whether step 203, judgment variable index_scend are equal to after variable i ndex_max adds 1 and doing the computing of mould 3 Value:If it is, the positive negative sense sign of the deviation of angle is 1;If it is not, then the positive negative sense sign of the deviation of angle is -1;
Step 204, the angle W_last for calculating final colour circle, formula is:W_last=start+sign*W.
With RGB(0.75、0.13、0.5)As a example by, the second corresponding relation that the rgb value is converted into the angle of colour circle is specific It is calculated as follows:
1st, three numerical values reciteds of component in rgb value are compared, 0.75 value is maximum, represents R component, and its manipulative indexing number is 0;0.13 value is minimum, represents G components, and its manipulative indexing number is 1;0.5 value therebetween, represents B component, its correspondence rope Quotation marks are 2;Then record index_max=0, index_scend=2, index_third=1.
2nd, normalized,(0.75、0.13、0.5)/0.75=RGB/(1.0、0.17、0.66).
3rd, off-center angle W=(RGB/[scend]—RGB/[third])* step, step=60/r, r=1-RGB/ [third], by RGB/[third]=0.17, RGB/[scend]=0.66 substitutes into above formula;Then step=60/ (1-0.17)=72.289, W=(0.66-0.17)*72.289=35.42.
4th, because index_max=0, then start angle start=0.
5、(index_max+1)%3=1, is not equal to index_scend(It is 2), then sign=-1.
6th, the angle W_last=start+sign*W=0+ of final colour circle(-1)*35.42=-35.42;Due to the angle For negative, it is necessary to convert thereof into positive-angle, 360-35.42=324.58 is used;So RGB(0.75、0.13、0.5)Corresponding color The angle of ring is 324.58 °.
In the specific implementation, rgb value is converted into the second corresponding relation of the angle of colour circle using the realization of following program codes:
1、RGB[0] = Rvalue , RGB[1] = Gvalue, RGB[2] = Bvalue // rgb value is initialized
2nd, Index_max=Max (Max (RGB [0], RGB [1]), RGB [2]) // ask for color component value Maximum index
3、If (RGB[(Index_max+1)%3] == RGB[(Index_max+2)%3 )
Return to the corresponding angles of RGB [Index_max];
If the 4, unequal, RGB [0] /=RGB [Index_max],
RGB [1] /=RGB [Index_max],
RGB [2] /=RGB [Index_max], the normalization of // component
5、Index_scend = Max(RGB[(Index_max+1)%3] , RGB[(Index_max+2)%3)
6、Index_third = Min(RGB[(Index_max+1)%3] , RGB[(Index_max+2)%3) // ask Take the index value of component size
7th, mapping radius r=1- RGB [index_third];Mapping step-length step=60/r;
8th, off-center angle is W=(RGB [index_scend]-RGB [index_third])* step;
9、if( index_max == 0 ) start = 0;
else if( index_max == 1) start = 120;
else start =240;
10th, calculate the positive negative sense sign of deviation and judge whether index_scend is equal to (index_max+1) %3, if equal to If sign=1 is not equal to sign=- 1,
11st, final angle is W_last=start+sign * W.
After setting the conversion regime between the angle of colour circle and rgb value, you can start to carry out the Icon Color applied Detection.In the step S200, it is gray-scale map to detect icon transformation after the color of icon, as shown in figure 5, in QQ icons 501 is yellow, and 502 is red, and 503 is black, and QQ icons are carried out into binary conversion treatment obtains its gray-scale map.The present embodiment is used The proportion of gray value is come which kind of color in the color for judging icon for domain color, i.e. which kind of color is most.The proportion of gray value It is that the number for counting a certain gray value accounts for the percentage of all gray scale numbers of image, it is prior art, and the present invention is to this It is not described further.
The maximum corresponding color of gray value of proportion is domain color, in step S300, obtains the rgb value of domain color, Be converted into according to above-mentioned rgb value the angle of colour circle the second corresponding relation calculate the domain color rgb value it is right on colour circle The angle answered.In scheme of colour, highlighted frequently with contrastive colours and two kinds of colors will not influence each other.Therefore, this reality Apply the angle that will be calculated in example and rotate 180 °, equivalent to the angle of the complementary color for obtaining domain color.In step S400, according to upper The angular transition of the colour circle stated calculates the corresponding rgb value of angle of complementary color into the first corresponding relation of rgb value, by the back of the body of icon Scenery is changed to the color of complementary color.
For the selection of above-mentioned complementary color, the present embodiment can also further be chosen.After the step S300 also Including:In the preset range on the basis of the angle of the complementary color, set angle of the angle as the complementary color is obtained at random Degree.Preset range on the basis of the angle of the complementary color is the angle of complementary color22.5°.Accordingly, in the step S400, Angular transition according to colour circle calculates the corresponding rgb value of set angle into the first corresponding relation of rgb value, by the background of icon Color is changed to the color of the corresponding complementary color of set angle.The range of choice of complementary color can so be expanded, color is more enriched.
In the specific implementation, it is also possible in the angle of complementary colorAn angle is selected as the back of the body by user in the range of 22.5 ° Scenery, makes background colour adjust requirement that is more flexible, having reached user, has provided the user more comfortable visual effect.
Based on the above-mentioned icon background color tone adjusting method based on colour circle, the embodiment of the present invention also provides a kind of terminal, please Include that conversion setup module 10, gradation processing module 20, color angle processing module 30 and color are adjusted refering to Fig. 6, the terminal Mould preparation block 40.Before icon background colour adjustment is carried out, the angular transition of colour circle is first pre-set by the conversion setup module 10 Into rgb value the first corresponding relation and set rgb value be converted into colour circle angle the second corresponding relation.Then by described Gradation processing module 20 detects the color of icon, is gray-scale map by icon transformation, calculates the ratio of the corresponding gray value of shades of colour Weight.The color angle processing module 30 is connected with gradation processing module 20, account for the largest percentage in result of calculation for being obtained The corresponding color of gray value rgb value;Color angle processing module 30 is also connected with conversion setup module 10, and it calls conversion The second corresponding relation that rgb value in setup module 10 is converted into the angle of colour circle calculates the corresponding angle of the color, by this Angle rotates 180 ° of angles for obtaining the complementary color of the color;Recall the angular transition of colour circle into the first corresponding relation of rgb value Calculate the corresponding rgb value of angle of complementary color.Color adjustment module 40 is connected with color angle processing module 30, and it is according to color The corresponding rgb value of angle of the complementary color that angle processing module 30 is calculated, the color that the background colour of icon is changed to complementary color.
The present embodiment also provides another complementary color selection mode, and the color angle processing module 30 is obtaining the angle of complementary color After degree, in the preset range on the basis of the angle of the complementary color, an angle is obtained at random or an angle is selected by user Spend as the set angle of the complementary color, such as in the angle of complementary colorIn the range of 22.5 °;Then the angular transition of colour circle is recalled The first corresponding relation into rgb value calculates the corresponding rgb value of set angle of complementary color.Color adjustment module 40 is then according to setting The corresponding rgb value of angle, the background colour of icon is changed to the color of the corresponding complementary color of set angle.
In sum, the present invention is provided icon background color tone adjusting method based on colour circle and terminal, using RGB three primary colors Colour circle icon background colour is automatically adjusted, angle subregion division is carried out to colour circle, by color and Qi Jiao on colour circle Degree is corresponded;In the Icon Color of detection application, icon transformation into gray-scale map and is obtained into the rgb value of domain color, according to The second corresponding relation that the rgb value for pre-setting is converted into the angle of colour circle calculates the angle of the corresponding colour circle of domain color, will The angle rotates 180 ° of angles of acquisition complementary color;Angular transition further according to colour circle is calculated into the first corresponding relation of rgb value The corresponding rgb value of angle of complementary color, the background colour of icon is changed to the color of complementary color;As a result of the trichromatic colors of RGB Ring is adjusted to Icon Color, improves the accuracy of color-match, makes the icon more natural with the collocation of its background colour, Increased the visual comfort at UI interfaces.
In addition, the present invention is after the angle for obtaining complementary color, can also be in the angle of complementary colorObtained at random in the range of 22.5 ° One angle is defined by the user set angle of the angle as the complementary color, calculates the corresponding rgb value reality of set angle The change of the background colour of existing icon;The flexibility of collocation of colour is increased, is easy to user to adjust.
It is understood that for those of ordinary skills, can be with technology according to the present invention scheme and its hair Bright design is subject to equivalent or change, and all these changes or replacement should all belong to the guarantor of appended claims of the invention Shield scope.

Claims (9)

1. a kind of icon background color tone adjusting method based on colour circle, it is characterised in that including:
A, the angular transition of colour circle is pre-set into the first corresponding relation of rgb value and the angle that rgb value is converted into colour circle is set Second corresponding relation of degree;
The color of B, detection icon, is gray-scale map by icon transformation, calculates the proportion of the corresponding gray value of shades of colour;
The rgb value of the corresponding color of gray value that C, acquisition account for the largest percentage, the of the angle of colour circle is converted into according to rgb value Two corresponding relations calculate the corresponding angle of the color, and the angle is rotated into 180 ° of angles for obtaining the complementary color of the color;
D, the corresponding rgb value of angle for calculating complementary color into the first corresponding relation of rgb value according to the angular transition of colour circle, will scheme Target background colour is changed to the color of complementary color;
The angular transition of the colour circle includes into the first corresponding relation of rgb value:
A1, rgb value is initialized as(0.0、0.0、0.0);
A2, the corresponding area of acquisition current angular, and corresponding call number;The angle is calculated according to the area and call number Rgb value;Specially:
Calculate corresponding first call number of the angle;The corresponding area of current angular is obtained according to the first call number, and according to first Call number is by the respective component assignment in rgb value;Further determine that in the area, the closer adjacent region of angle, by rgb value Respective component change.
2. the icon background color tone adjusting method based on colour circle according to claim 1, it is characterised in that in the step C Also include afterwards:In the preset range on the basis of the angle of the complementary color, an angle is obtained at random as the complementary color Set angle;
In the step D, it is corresponding that the angular transition according to colour circle calculates set angle into the first corresponding relation of rgb value Rgb value, the background colour of icon is changed to the color of the corresponding complementary color of set angle.
3. the icon background color tone adjusting method based on colour circle according to claim 2, it is characterised in that the angle of the complementary color Preset range on the basis of degree is the angle of complementary color22.5°。
4. the icon background color tone adjusting method based on colour circle according to claim 1, it is characterised in that in the step A Also include the angle initialization to colour circle before, specifically include:
A01,360 ° of colour circle is divided into Zone R, G areas, B areas, each region accounts for 120 °;
A02, the start angle of definition Zone R are 0 °, and call number is 0, and rgb value is(1.0、0.0、0.0);Define the initial angle in G areas It is 120 ° to spend, and call number is 1, and rgb value is(0.0、1.0、0.0);The start angle for defining B areas is 240 °, and call number is 2, RGB It is worth and is(0.0、0.0、1.0);
A03, by the angled index corresponding table of three content creatings in area for defining and store.
5. the icon background color tone adjusting method based on colour circle according to claim 4, it is characterised in that the step A2 tools Body includes:
Business is done the computing of mould 3 and obtains corresponding first call number of the angle by A21, calculating current angular divided by 120 business;According to First call number obtains the corresponding area of current angular, and the respective component in rgb value is entered as into 1.0 according to the first call number;
A22, calculating current angular compare remainder and 60 size divided by 120 remainder;When remainder is more than or equal to 60, will First call number does the computing of mould 3 and obtains the second call number after adding 1, perform step A23;When remainder is less than 60, step is performed A24;
A23, the respective component in rgb value is entered as 1.0 according to the second call number;The phase of the corresponding rgb value of the first call number Component is answered to be changed to, wherein, x represent current angular divided by 120 remainder;
Respective component in A24, the corresponding rgb value of the first call number is changed to, wherein, x represent current angular divided by 120 remainder.
6. the icon background color tone adjusting method based on colour circle according to claim 4, it is characterised in that in the step A In, the second corresponding relation that the rgb value is converted into the angle of colour circle includes:
A10, to rgb value in three components sorted by numerical values recited and mark its corresponding call number respectively;Rgb value is done Normalized obtains normalizing rgb value;
A20, off-center angle is calculated according to normalization rgb value, start angle is calculated according to call number and the inclined of angle is judged From positive negative sense, according to off-center angle, start angle, deviate the angle that positive negative sense calculates colour circle.
7. the icon background color tone adjusting method based on colour circle according to claim 6, it is characterised in that the step A10 Specifically include:
A101, compare three numerical values reciteds of component in rgb value, the corresponding index of record variable index_max=largest components Number, the corresponding call number of variable i ndex_scend=Middle Components, the corresponding call number of variable i ndex_third=minimum components;
A102, the value that the value of three components in rgb value is respectively divided by largest component, obtain normalizing rgb value.
8. the icon background color tone adjusting method based on colour circle according to claim 6, it is characterised in that the step A20 Specifically include:
A201, off-center angle W is calculated, formula is:
W=(RGB/[scend]—RGB/[third])* step, step=60/r, r=1-RGB/[third];Wherein, step tables Show mapping step-length, r represents mapping radius, RGB/[third] represents the numerical value of the minimum component in normalization rgb value;RGB/ [scend] represents the numerical value of the Middle Component in normalization rgb value;
A202, the corresponding start angle start of query interface index_max in angle index corresponding table;
Whether A203, judgment variable index_scend are equal to value that is after variable i ndex_max adds 1 and doing the computing of mould 3:If It is that then the positive negative sense sign of the deviation of angle is 1;If it is not, then the positive negative sense sign of the deviation of angle is -1;
A204, the angle W_last for calculating final colour circle, formula is:W_last=start+sign*W.
9. it is a kind of for realize as claimed in claim 1 based on colour circle icon background color tone adjusting method terminal, its feature It is, including:
Conversion setup module, for pre-setting the angular transition of colour circle into first corresponding relation and setting RGB of rgb value Value is converted into the second corresponding relation of the angle of colour circle;
Gradation processing module, icon transformation is gray-scale map by the color for detecting icon, calculates the corresponding gray scale of shades of colour The proportion of value;
Color angle processing module, the rgb value of the corresponding color of gray value on the one hand being accounted for the largest percentage for acquisition, according to The second corresponding relation that rgb value is converted into the angle of colour circle calculates the corresponding angle of the color, and by angle rotation, 180 ° are obtained Take the angle of the complementary color of the color;On the other hand it is used to be calculated into the first corresponding relation of rgb value according to the angular transition of colour circle Go out the corresponding rgb value of angle of complementary color;
Color adjustment module, the corresponding rgb value of angle of the complementary color for being calculated according to color angle processing module, will scheme Target background colour is changed to the color of complementary color.
CN201310330761.9A 2013-08-01 2013-08-01 A kind of icon background color tone adjusting method and terminal based on colour circle Expired - Fee Related CN103544004B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310330761.9A CN103544004B (en) 2013-08-01 2013-08-01 A kind of icon background color tone adjusting method and terminal based on colour circle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310330761.9A CN103544004B (en) 2013-08-01 2013-08-01 A kind of icon background color tone adjusting method and terminal based on colour circle

Publications (2)

Publication Number Publication Date
CN103544004A CN103544004A (en) 2014-01-29
CN103544004B true CN103544004B (en) 2017-06-06

Family

ID=49967485

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310330761.9A Expired - Fee Related CN103544004B (en) 2013-08-01 2013-08-01 A kind of icon background color tone adjusting method and terminal based on colour circle

Country Status (1)

Country Link
CN (1) CN103544004B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9665952B2 (en) 2014-02-19 2017-05-30 Beijing Lenovo Software Ltd. Information processing method and electronic device
CN103870155B (en) * 2014-02-21 2017-08-25 联想(北京)有限公司 The method and electronic equipment of information processing
CN103885687B (en) * 2014-02-20 2017-11-28 联想(北京)有限公司 A kind of information processing method and electronic equipment
CN104035665B (en) * 2014-06-13 2017-12-01 Tcl集团股份有限公司 A kind of method and apparatus that desktop icons are carried out with colors countenance
CN104090711B (en) * 2014-06-30 2017-12-22 宇龙计算机通信科技(深圳)有限公司 The chassis color display and device of a kind of icon
CN104050004B (en) * 2014-06-30 2018-01-09 宇龙计算机通信科技(深圳)有限公司 interface icon color setting method, device and terminal
US9854158B2 (en) * 2015-11-02 2017-12-26 Olympus Corporation Image adjusting apparatus
CN105653128B (en) * 2015-12-29 2019-03-15 厦门美图移动科技有限公司 A kind of application icon generation method, device and mobile terminal
CN105677349A (en) * 2016-01-05 2016-06-15 努比亚技术有限公司 Desktop icon display method and device
WO2018058690A1 (en) 2016-09-30 2018-04-05 华为技术有限公司 Display method for edges of rectangular frame, and terminal
CN107241637B (en) * 2017-05-26 2020-01-31 四川长虹电器股份有限公司 Method for intelligently matching application icons with backboard color plates based on HSB color mode
CN111406245A (en) * 2017-12-01 2020-07-10 深圳市柔宇科技有限公司 Selection method of handwriting input tool, mobile terminal and storage medium
CN108596997B (en) * 2018-04-15 2020-04-24 西南交通大学 Dynamic visualization method for statistical characteristics of coronal darkening images
CN112860357B (en) * 2019-11-26 2023-06-16 上海哔哩哔哩科技有限公司 Animation resource rendering method and device, computer equipment and storage medium
CN113342231A (en) * 2021-06-29 2021-09-03 的卢技术有限公司 Vehicle-mounted display screen dynamic color matching method, system, medium and equipment based on deep learning

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102047293A (en) * 2008-04-21 2011-05-04 威仕达品特技术有限公司 System and method for automatically generating color scheme variations
CN102508666A (en) * 2011-11-11 2012-06-20 宇龙计算机通信科技(深圳)有限公司 Method and device for adjusting application prompt message in application program
CN103136764A (en) * 2011-11-25 2013-06-05 捷达世软件(深圳)有限公司 Method and system for analyzing picture foreground colors
CN103151022A (en) * 2013-01-31 2013-06-12 广东欧珀移动通信有限公司 Method for automatically changing font colors according to background color and system
CN103207778A (en) * 2012-01-13 2013-07-17 青岛海信移动通信技术股份有限公司 Method, device and mobile terminal for modifying icons

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102047293A (en) * 2008-04-21 2011-05-04 威仕达品特技术有限公司 System and method for automatically generating color scheme variations
CN102508666A (en) * 2011-11-11 2012-06-20 宇龙计算机通信科技(深圳)有限公司 Method and device for adjusting application prompt message in application program
CN103136764A (en) * 2011-11-25 2013-06-05 捷达世软件(深圳)有限公司 Method and system for analyzing picture foreground colors
CN103207778A (en) * 2012-01-13 2013-07-17 青岛海信移动通信技术股份有限公司 Method, device and mobile terminal for modifying icons
CN103151022A (en) * 2013-01-31 2013-06-12 广东欧珀移动通信有限公司 Method for automatically changing font colors according to background color and system

Also Published As

Publication number Publication date
CN103544004A (en) 2014-01-29

Similar Documents

Publication Publication Date Title
CN103544004B (en) A kind of icon background color tone adjusting method and terminal based on colour circle
CN106971165B (en) A kind of implementation method and device of filter
CN104778047B (en) A kind of content display method and terminal
CN104076928B (en) A kind of method for adjusting text importing image
CN105701773B (en) A kind of method and device of quick processing image
WO2006057126A1 (en) Pixel processor
CN105282531A (en) Low grayscale white balance control method and device
CN104157261A (en) Display mode adjusting method of display device and display mode adjusting module thereof
CN102663741A (en) Method for carrying out visual stereo perception enhancement on color digit image and system thereof
CN110675839A (en) Screen adjusting method, electronic equipment and related device
CN102402367A (en) Method for implementing dynamic theme in mobile phone terminal
CN103236251B (en) Method and device for calibrating uniformity of splicing wall
CN105611694B (en) A kind of color configuration method and apparatus of atmosphere lamp
CN104641631B (en) By the color enhancement of gamut extension
CN106531070A (en) Control chip, control method, OLED display device and control host machine
CN104639924B (en) It is a kind of to reduce the method that color value precision is improved to device pixel degree of dependence
CN104090711B (en) The chassis color display and device of a kind of icon
JP6484592B2 (en) Color arrangement proposing device, color arrangement proposing method and program
WO2013073892A1 (en) Method and apparatus for dynamically visualizing a collection of images in the form of a collage
CN106791741B (en) Multi-screen marching method and device
CN110324476A (en) A kind of characterizing method of Mobile phone screen color generation property
CN113873210B (en) Color restoration authenticity precision detection method
CN113838436B (en) Color temperature adjusting method, device, storage medium and electronic equipment
CN109803093B (en) Imaging method of virtual fitting and virtual fitting equipment
CN102843577A (en) Debug processing method and device for color space of digital television

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170606