Invention content
In view of this, the application provides a kind of color configuration method and apparatus of atmosphere lamp, it can be according to the needs of client, base
The color of atmosphere lamp is configured in multiple color, meets requirement of the different clients to color experience.
To achieve the goals above, it is proposed that scheme it is as follows:
A kind of color configuration method of atmosphere lamp, including:
The colouring information that user is chosen by operation interface is obtained, the colouring information includes at least the kind of selected color
Class;
According to the correspondence of pre-set optional color and RGB ratios, the RGB ratios of each selected color are determined,
To determine the rgb value of each selected color, the rgb value includes R values, G values and B values;
According to the rgb value of all selected colors, the R values summation, G values summation and B value summations of the colouring information are calculated,
With the RGB ratios of the determination colouring information;
According to the RGB ratios of the colouring information, rgb light source is controlled, completes color configuration.
Preferably, the colouring information further includes the selection number of selected color.
Preferably, the rgb value according to all selected colors calculates R values summation, the G value summations of the colouring information
And B value summations, including:
According to preset formula
Calculate the R values summation, G values summation and B value summations of the colouring information;
Wherein, M indicates that the type for being chosen color, N indicate that the selection number for being chosen color, R_M indicate the R for being chosen color
Value, G_M indicate that the G values for being chosen color, B_M indicate the B values for being chosen color.
Preferably, the RGB ratios according to the colouring information further include before controlling rgb light source:
Obtain the luminance information that user is chosen by operation interface;
The RGB ratios according to the colouring information control rgb light source, including:
According to the RGB ratios of the colouring information and the luminance information, each primary lights in the rgb light source are calculated
Source PWM duty cycle;
The PWM duty cycle of each primary light source in the calculated rgb light source carries out the rgb light source
Control.
Preferably, the RGB ratios according to the colouring information further include before controlling rgb light source:
Obtain the luminance information that user is chosen by operation interface;
The RGB ratios according to the colouring information control rgb light source, including:
According to the RGB ratios of the colouring information and the luminance information, each primary lights in the rgb light source are calculated
The electric current in source;
The electric current of each primary light source in the calculated rgb light source, controls the rgb light source.
A kind of color configuration device of atmosphere lamp, including:
Colouring information collecting unit, the colouring information chosen by operation interface for obtaining user;
Rgb value determination unit determines each for the correspondence according to pre-set optional color and RGB ratios
The rgb value of selected color, the rgb value includes R values, G values and B values;
RGB ratio-dependent units calculate the R values of the colouring information for the rgb value according to all selected colors
Summation, G values summation and B value summations, with the RGB ratios of the determination colouring information;
Control unit controls rgb light source for the RGB ratios according to the colouring information, completes color and matches
It sets.
Preferably, the RGB ratio-dependents unit, including:
First computing module, for according to preset formulaCalculate the R values of the colouring information
Summation;
Second computing module, for according to preset formulaCalculate the G values of the colouring information
Summation;
Third computing module, for according to preset formulaCalculate the B values of the colouring information
Summation.
Ratio-dependent module determines institute for the R values summation, G values summation and B value summations according to the colouring information
State the RGB ratios of colouring information;
Wherein, M indicates that the type for being chosen color, N indicate that the selection number for being chosen color, R_M indicate the R for being chosen color
Value, G_M indicate that the G values for being chosen color, B_M indicate the B values for being chosen color.
Preferably, further include:Luminance information collecting unit is believed for obtaining user by the brightness that operation interface is chosen
Breath.
Preferably, described control unit includes:
4th computing module, for according to the colouring information RGB ratios and the luminance information, described in calculating
Each primary light source PWM duty cycle in rgb light source;
First control module, the PWM duty cycle of each primary light source for the calculated rgb light source,
The rgb light source is controlled.
Preferably, described control unit includes:
5th computing module, for according to the colouring information RGB ratios and the luminance information, described in calculating
The electric current of each primary light source in rgb light source;
Second control module, the electric current of each primary light source for the calculated rgb light source, to described
Rgb light source is controlled.
As can be seen from the above technical solutions, this application discloses a kind of color configuration method and apparatus of atmosphere lamp.The party
Method utilizes pair of pre-set optional color and RGB ratios after obtaining the colouring information that user is chosen by operation interface
It should be related to, the RGB ratios of each selected color be determined, to obtain the R values, G values and B values of each selected color.In turn, it obtains
To the R values summation, G values summation and B value summations of the colouring information, the RGB ratios of the colouring information are finally determined.Into one
Step, controls rgb light source according to the RGB ratios of the colouring information, realizes the configuration of color.That is, of the invention
The fractionation and recombination that color can be achieved, are split as minimum unit by different colors, different colors are all made of RGB ratio tables
Show, and recombinated, realize the configuration of different colours, thus meets requirement of the different clients to color experience.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
A kind of flow signal of the color configuration method of atmosphere lamp disclosed in one embodiment of the invention is shown referring to Fig. 1
Figure.
As shown in Figure 1, this method includes:
S11:The colouring information that user is chosen by operation interface is obtained, the colouring information includes at least selected color
Type.
User can choose the color liked by the operation interface of setting in the car, in order to meet different user pair
Different colours are liked, a variety of different colors can be arranged in operation interface, such as red, orange, yellow, green, cyan, indigo plant
Color, purple and pink colour etc..User passes through the color button that is arranged on trigger action interface, you can to different types of color into
Row is chosen.
S12:According to the correspondence of pre-set optional color and RGB ratios, the RGB ratios of each selected color are determined
Example, to determine the rgb value of each selected color, the rgb value includes R values, G values and B values.
It should be noted that three kinds of primary colours configurations of red, green, blue, the three primary colours ratio of each color can be used in all colours
Example is different, i.e., RGB ratios are different.The size of R in the RGB ratios, i.e., R values of the present invention, similarly G values and B values.
In addition, when RGB (red, green, blue) proportionate relationship to optional color is configured, need using unified standard.
For example the RGB ratios of optional color are a:b:C, then a+b+c=k, the k values are definite value, i.e., the k values of all optional colors are homogeneous
Deng to ensure that the RGB ratios of each color are set under unified standard.
S13:According to the rgb value of all selected colors, R values summation, G values summation and the B values of the colouring information are calculated
Summation, with the RGB ratios of the determination colouring information.
S14:According to the RGB ratios of the colouring information, rgb light source is controlled, completes color configuration.
As seen from the above embodiment, this application discloses a kind of color configuration methods of atmosphere lamp.This method is obtaining use
After the colouring information that family is chosen by operation interface, the correspondence of pre-set optional color and RGB ratios is utilized, is determined
The RGB ratios of each selected color, to obtain the R values, G values and B values of each selected color.In turn, the color is obtained
R values summation, G values summation and the B value summations of information finally determine the RGB ratios of the colouring information.Further, according to institute
The RGB ratios for stating colouring information control rgb light source, realize the configuration of color.That is, color can be achieved in the present invention
Fractionation and recombination, different colors is split as minimum unit, different colors, which is all made of RGB ratios, to be indicated, and is carried out
Recombination, realizes the configuration of different colours, thus meets requirement of the different clients to color experience.
In real life, user may compare preference to color in certain, thus in order to meet user demand, in the present invention
In disclosed other embodiment, user not only configures atmosphere lamp color using multiple color, in configuration process
Also certain color can repeatedly be selected, such as select color for:It is red+red+red+yellow+green, that is, select red three times, primary Huang
Color, primary green.
R values summation, G values summation and the B values that the colouring information can be calculated by the following formula in the present embodiment are total
With.
According to preset formulaCalculate the R value summations of the colouring information;
According to preset formulaCalculate the G value summations of the colouring information;
According to preset formulaCalculate the B value summations of the colouring information.
Wherein, M indicates that the type for being chosen color, N indicate that the selection number for being chosen color, R_M indicate the R for being chosen color
Value, G_M indicate that the G values for being chosen color, B_M indicate the B values for being chosen color.
In practical applications, user is while the color to atmosphere lamp configures, it is also necessary to the brightness to atmosphere lamp
It is adjusted.Optionally, can by control each primary light source in rgb light source PWM (Pulse Width Modulation,
Pulse width is modulated) duty ratio, the color and brightness in the rgb light source are adjusted, it also can be by controlling each of rgb light source
The brightness of the color in rgb light source is adjusted in the electric current of a primary light source.Show that a kind of PWM of atmosphere lamp is accounted for referring to Fig. 2 a
For sky than adjusting method, Fig. 2 b show a kind of current control process of atmosphere lamp.
Show that a kind of flow of the color configuration method of atmosphere lamp is shown disclosed in another embodiment of the present invention referring to Fig. 3
It is intended to.
The color of atmosphere lamp and brightness is adjusted in the method for using PWM duty cycle to adjust in the present embodiment.
From the figure 3, it may be seen that this approach includes the following steps:
S31:Obtain colouring information and luminance information that user is chosen by operation interface.
Wherein, the colouring information includes the type of selected color and the selection number of selected color, the brightness letter
Breath includes brightness value.
S32:According to the correspondence of pre-set optional color and RGB ratios, the RGB ratios of each selected color are determined
Example, to determine the rgb value of each selected color, the rgb value includes R values, G values and B values.
Optionally, the correspondence of the optional color and RGB ratios can there are the memories of system by way of table
In.After system obtains the colouring information that user is selected by operation interface, RGB ratio tables are called, you can obtain each quilt
Select the rgb value of color.
S33:According to the rgb value of all selected colors, R values summation, G values summation and the B values of the colouring information are calculated
Summation, with the RGB ratios of the determination colouring information.
The new R values summation of color, G values summation and B value summations are calculated separately using following formula:
According to preset formulaCalculate the R value summations of the colouring information;According to preset formulaCalculate the G value summations of the colouring information;According to preset formulaMeter
Calculate the B value summations of the colouring information.In turn, the RGB ratios of the colouring information are determined.
S34:According to the RGB ratios of the colouring information and the luminance information, each base in the rgb light source is calculated
Color light source PWM duty cycle.
The detailed process of above-mentioned steps is:
1, the brightness value selected according to user, determines total PWM duty cycle of the three primary light source in rgb light source.
2, the PWM duty cycle ratio of the ratio-dependent three primary light source shared by R, G and B in RGB ratios.
3, according to total PWM duty cycle of three primary light source and PWM duty cycle ratio, the duty ratio of three primary light source is calculated
4, the PWM duty cycle of calculated each primary light source controls the rgb light source.
Such as, when the brightness value that user selects is 50, determine that total PWM duty cycle of three primary light source is 50%, i.e. PWM_
SUM=50%.
Then, formula is utilized
PWM_R=50%*R_SUM/ (R_SUM+G_SUM+B_SUM);
PWM_G=50%*G_SUM/ (R_SUM+G_SUM+B_SUM);
PWM_B=50%*B_SUM/ (R_SUM+G_SUM+B_SUM);
Calculate separately the duty ratio of three primary light source.
S35:The PWM duty cycle of each primary light source in the calculated rgb light source, to the rgb light source
It is controlled.
Optionally, it in another embodiment disclosed by the invention, can be realized to RGB lamps by controlling rgb light ource electric current
The control in source.Unlike upper one embodiment, need in the present embodiment predefine the rgb light source electric current with it is bright
The correspondence of angle value.If the current regulation scope in the rgb light source is 0~1A, the adjustable range of brightness value is 0~100, then
It determines when brightness value is 50, the total current in rgb light source is 0.5A.In turn, the size of current of each three primary light source is calculated.
Show that a kind of structure of the color configuration device of atmosphere lamp is shown disclosed in another embodiment of the present invention referring to Fig. 4
It is intended to.
The device includes in the present embodiment:Colouring information collecting unit 1, rgb value determination unit 2, RGB ratio-dependent units
3 and control unit 4.
Wherein, colouring information collecting unit, the colouring information chosen by operation interface for obtaining user.
The colouring information includes at least the type of selected color.
The rgb value determination unit is determined for the correspondence according to pre-set optional color and RGB ratios
The rgb value of each selected color, the rgb value includes R values, G values and B values.
It should be noted that when the RGT proportionate relationships to optional color are configured, need using unified standard.Protect
Card, the summation of the rgb value of all optional colors are equal.
The RGB ratio-dependents unit calculates the colouring information for the rgb value according to all selected colors
R values summation, G values summation and B value summations, with the RGB ratios of the determination colouring information.
Described control unit controls rgb light source for the RGB ratios according to the colouring information, completes color
Configuration.
Show that a kind of structure of the color configuration device of atmosphere lamp is shown disclosed in another embodiment of the present invention referring to Fig. 5
It is intended to.
Unlike upper one embodiment, in the present embodiment, the device in addition to include colouring information collecting unit 1,
Further include passing through operation interface for obtaining user outside rgb value determination unit 2, RGB ratio-dependents unit 3 and control unit 4
The luminance information collecting unit 5 of the luminance information of selection.
In addition, the RGB ratio-dependents unit includes in the present embodiment:First computing module 31, the second computing module
32, third computing module 33 and ratio-dependent module 34.
Wherein, first computing module is used for according to preset formulaCalculate the color
The R value summations of information.
Second computing module is used for according to preset formulaCalculate the colouring information
G value summations.
The third computing module is used for according to preset formulaCalculate the colouring information
B value summations.
Wherein, M indicates that the type for being chosen color, N indicate that the selection number for being chosen color, R_M indicate the R for being chosen color
Value, G_M indicate that the G values for being chosen color, B_M indicate the B values for being chosen color.
In turn, ratio-dependent module determines the RGB ratios of the colouring information according to the output valve of above three computing module
Example.
Optionally, described control unit includes:4th computing module 41 and the first control module 42.
Wherein, the 4th computing module is used for the RGB ratios according to the colouring information and the luminance information, meter
Calculate each primary light source PWM duty cycle in the rgb light source.
PWM duty of first control module for each primary light source in the calculated rgb light source
Than controlling the rgb light source.
In a upper device embodiment, the control module is realized by controlling the PWM duty cycle of RGB lamp sources to RGB
The control of lamp source.It should be noted that the control unit described in other device embodiments disclosed by the invention can pass through control
The electric current of RGB lamp sources controls RGB lamp sources.
Specifically, described control unit includes:5th computing module and the second control module.
Wherein, the 5th computing module is used for the RGB ratios according to the colouring information and the luminance information, calculates institute
State the electric current of each primary light source in rgb light source;
Electric current of second control module for each primary light source in the calculated rgb light source, it is right
The rgb light source is controlled.
It should be noted that the device embodiment is corresponding with embodiment of the method, implementation procedure is identical with implementation principle,
Therefore not to repeat here.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by
One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning
Covering non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only that
A little elements, but also include other elements that are not explicitly listed, or further include for this process, method, article or
The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged
Except there is also other identical elements in the process, method, article or apparatus that includes the element.
Each embodiment is described by the way of progressive in this specification, the highlights of each of the examples are with other
The difference of embodiment, just to refer each other for identical similar portion between each embodiment.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention.
Various modifications to these embodiments will be apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest range caused.