Summary of the invention
In view of this, the application provides a kind of color configuration method and apparatus of atmosphere lamp, can be according to client's needs, baseIn multiple color, the color of atmosphere lamp is configured, has met the requirement of different clients to color experience.
To achieve these goals, the existing scheme proposing is as follows:
A color configuration method for atmosphere lamp, comprising:
Obtain the colouring information that user chooses by operation interface, described colouring information at least comprises the kind of selected colorClass;
According to the corresponding relation of the selective color setting in advance and RGB ratio, determine the RGB ratio of each selected color,To determine the rgb value of each selected color, described rgb value comprises R value, G value and B value;
According to the rgb value of all selected colors, calculate R value summation, G value summation and the B value summation of described colouring information,To determine the RGB ratio of described colouring information;
According to the RGB ratio of described colouring information, rgb light source is controlled, complete color configuration.
Preferably, described colouring information also comprises the number of times of choosing of selected color.
Preferably, described according to the rgb value of all selected colors, calculate R value summation, the G value summation of described colouring informationAnd B value summation, comprising:
According to default formula Calculate R value summation, G value summation and the B value summation of described colouring information;
Wherein, M represents the kind of selected color, and N represents the number of times of choosing of selected color, and R_M represents the R of selected colorValue, G_M represents the G value of selected color, B_M represents the B value of selected color.
Preferably, described according to the RGB ratio of described colouring information, before rgb light source is controlled, also comprise:
Obtain the monochrome information that user chooses by operation interface;
Describedly according to the RGB ratio of described colouring information, rgb light source is controlled, being comprised:
According to the RGB ratio of described colouring information and described monochrome information, calculate each primary lights in described rgb light sourceSource PWM dutycycle;
The PWM dutycycle of each primary light source in the described rgb light source that utilization calculates, carries out described rgb light sourceControl.
Preferably, described according to the RGB ratio of described colouring information, before rgb light source is controlled, also comprise:
Obtain the monochrome information that user chooses by operation interface;
Describedly according to the RGB ratio of described colouring information, rgb light source is controlled, being comprised:
According to the RGB ratio of described colouring information and described monochrome information, calculate each primary lights in described rgb light sourceThe electric current in source;
The electric current of each primary light source in the described rgb light source that utilization calculates, controls described rgb light source.
A color configuration device for atmosphere lamp, comprising:
Colouring information collecting unit, the colouring information of choosing by operation interface for obtaining user;
Rgb value determining unit, for according to the selective color setting in advance and the corresponding relation of RGB ratio, determines eachThe rgb value of selected color, described rgb value comprises R value, G value and B value;
RGB ratio-dependent unit, for according to the rgb value of all described selected colors, calculates the R value of described colouring informationSummation, G value summation and B value summation, to determine the RGB ratio of described colouring information;
Control module, for according to the RGB ratio of described colouring information, controls rgb light source, completes color and joinsPut.
Preferably, described RGB ratio-dependent unit, comprising:
The first computing module, for the default formula of basisCalculate the R value of described colouring informationSummation;
The second computing module, for the default formula of basisCalculate the G value of described colouring informationSummation;
The 3rd computing module, for the default formula of basisCalculate the B value of described colouring informationSummation.
Ratio-dependent module, for according to the R value summation of described colouring information, G value summation and B value summation, determines instituteState the RGB ratio of colouring information;
Wherein, M represents the kind of selected color, and N represents the number of times of choosing of selected color, and R_M represents the R of selected colorValue, G_M represents the G value of selected color, B_M represents the B value of selected color.
Preferably, also comprise: monochrome information collecting unit, the brightness letter of choosing by operation interface for obtaining userBreath.
Preferably, described control module comprises:
The 4th computing module, for according to the RGB ratio of described colouring information and described monochrome information, described in calculatingEach primary light source PWM dutycycle in rgb light source;
The first control module, for utilizing the PWM dutycycle of each primary light source in the described rgb light source calculating,Described rgb light source is controlled.
Preferably, described control module comprises:
The 5th computing module, for according to the RGB ratio of described colouring information and described monochrome information, described in calculatingThe electric current of each primary light source in rgb light source;
The second control module, for utilizing the electric current of each primary light source in the described rgb light source calculating, to describedRgb light source is controlled.
Through as shown from the above technical solution, the application discloses a kind of color configuration method and apparatus of atmosphere lamp. The partyMethod is being obtained after the colouring information that user chooses by operation interface, utilizes the right of the selective color that sets in advance and RGB ratioShould be related to, determine the RGB ratio of each selected color, thereby obtain R value, G value and the B value of each selected color. And then,To R value summation, G value summation and the B value summation of described colouring information, finally determine the RGB ratio of described colouring information. Enter oneStep, controls rgb light source according to the RGB ratio of described colouring information, realizes the configuration of color. That is to say the present inventionCan realize fractionation and the restructuring of color, different colors is split as to minimum unit, different colors is all adopted to RGB schedule of proportionShow, and recombinate, realize the configuration of different colours, thereby met the requirement of different clients to color experience.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, completeDescribe, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiment wholely. Based onEmbodiment in the present invention, those of ordinary skill in the art are not making obtain under creative work prerequisite every otherEmbodiment, belongs to the scope of protection of the invention.
Show the flow process signal of the color configuration method of the disclosed a kind of atmosphere lamp of one embodiment of the invention referring to Fig. 1Figure.
As shown in Figure 1, the method comprises:
S11: obtain the colouring information that user chooses by operation interface, described colouring information at least comprises selected colorKind.
User can choose the color of liking by the operation interface being arranged in car, in order to meet different user pairLiking of different colours can arrange multiple different color, as red, orange, yellow, green, cyan, indigo plant on operation interfaceLook, purple and pink colour etc. User, by the color button arranging on trigger action interface, can enter different types of colorRow is chosen.
S12: according to the corresponding relation of the selective color setting in advance and RGB ratio, determine the RGB ratio of each selected colorExample, to determine the rgb value of each selected color, described rgb value comprises R value, G value and B value.
It should be noted that, all colours all can adopt three kinds of primary colours configurations of red, green, blue, the three primary colours ratio of every kind of colorExample is different, i.e. RGB ratio difference. The size of R in this RGB ratio, i.e. R value of the present invention, in like manner G value and B value.
In addition, in the time that the RGB to selective color (red, green, blue) proportionate relationship arranges, need to adopt unified standard.Such as the RGB ratio of selective color is a:b:c, a+b+c=k, this k value is definite value, i.e. the k value homogeneous phase of all selective colorsDeng, set under unified standard with the RGB ratio that ensures every kind of color.
S13: according to the rgb value of all selected colors, calculate R value summation, G value summation and the B value of described colouring informationSummation, to determine the RGB ratio of described colouring information.
S14: according to the RGB ratio of described colouring information, rgb light source is controlled, completed color configuration.
As seen from the above embodiment, the application discloses a kind of color configuration method of atmosphere lamp. The method is being obtained useAfter the colouring information that family is chosen by operation interface, the selective color that utilization sets in advance and the corresponding relation of RGB ratio, determineThe RGB ratio of each selected color, thus R value, G value and the B value of each selected color obtained. And then, obtain described colorR value summation, G value summation and the B value summation of information, finally the RGB ratio of definite described colouring information. Further, according to instituteState the RGB ratio of colouring information rgb light source is controlled, realize the configuration of color. That is to say, the present invention can realize colorFractionation and restructuring, different colors is split as to minimum unit, all adopt RGB ratio to represent different colors, and carry outRestructuring, realizes the configuration of different colours, thereby has met the requirement of different clients to color experience.
In real life, user may relatively have a preference for color in certain, thereby in order to meet consumers' demand, in the present inventionIn disclosed other embodiment, user not only can utilize multiple color to be configured atmosphere lamp color, in to layoutprocedureAlso can repeatedly select certain color, as selected color to be: red+red+red+yellow+green, select redness three times, once yellowLook, once green.
Can calculate R value summation, G value summation and the B value of described colouring information by following formula in the present embodiment totalWith.
According to default formulaCalculate the R value summation of described colouring information;
According to default formulaCalculate the G value summation of described colouring information;
According to default formulaCalculate the B value summation of described colouring information.
Wherein, M represents the kind of selected color, and N represents the number of times of choosing of selected color, and R_M represents the R of selected colorValue, G_M represents the G value of selected color, B_M represents the B value of selected color.
In actual applications, user, when the color of atmosphere lamp is configured, also needs the brightness to atmosphere lampRegulate. Optionally, can by control rgb light source each primary light source PWM (PulseWidthModulation,Pulse width modulation) dutycycle, color and the brightness in described rgb light source are regulated, also can be by controlling the each of rgb light sourceThe brightness of the color of the electric current of individual primary light source to rgb light source regulates. The PWM that shows a kind of atmosphere lamp referring to Fig. 2 a accounts forEmpty than control method, Fig. 2 b shows a kind of current control process of atmosphere lamp.
The flow process that shows the color configuration method of the disclosed a kind of atmosphere lamp of another embodiment of the present invention referring to Fig. 3 is shownIntention.
Color and the brightness of the method that adopts in the present embodiment PWM duty cycle adjustment to atmosphere lamp regulates.
As shown in Figure 3, the method comprises the following steps:
S31: obtain colouring information and monochrome information that user chooses by operation interface.
Wherein, described colouring information comprises the number of times of choosing of the kind of selected color and selected color, described brightness letterBreath comprises brightness value.
S32: according to the corresponding relation of the selective color setting in advance and RGB ratio, determine the RGB ratio of each selected colorExample, to determine the rgb value of each selected color, described rgb value comprises R value, G value and B value.
Optionally, can there is by the mode of form the memory of system in the corresponding relation of this selective color and RGB ratioIn. When after the colouring information that system acquisition user selects by operation interface, call RGB ratio form, can obtain each quiltSelect the rgb value of color.
S33: according to the rgb value of all selected colors, calculate R value summation, G value summation and the B value of described colouring informationSummation, to determine the RGB ratio of described colouring information.
Utilize following formula to calculate respectively R value summation, G value summation and the B value summation that color is new:
According to default formulaCalculate the R value summation of described colouring information; According to default formulaCalculate the G value summation of described colouring information; According to default formulaCalculate the B value summation of described colouring information. And then, determine the RGB ratio of described colouring information.
S34: according to the RGB ratio of described colouring information and described monochrome information, calculate each base in described rgb light sourceColor light source PWM dutycycle.
The detailed process of above-mentioned steps is:
1,, according to the brightness value of user's selection, determine total PWM dutycycle of the three primary light source in rgb light source.
2, according to the PWM dutycycle ratio of the shared ratio-dependent three primary light source of R, G and B in RGB ratio.
3,, according to total PWM dutycycle of three primary light source and PWM dutycycle ratio, calculate the dutycycle of three primary light source
4, utilize the PWM dutycycle of each primary light source calculating, described rgb light source is controlled.
As, in the time that the brightness value of user's selection is 50, determine that total PWM dutycycle of three primary light source is 50%, i.e. PWM_SUM=50%。
Then, utilize formula
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 respectively the dutycycle of three primary light source.
S35: utilize the PWM dutycycle of each primary light source in the described rgb light source calculating, to described rgb light sourceControl.
Optionally, in another embodiment disclosed by the invention, can realize RGB lamp by controlling rgb light source electric currentThe control in source. Different from a upper embodiment, need in the present embodiment to pre-determine the electric current in described rgb light source and brightThe corresponding relation of degree value. If the electric current adjustable range in described rgb light source is 0~1A, the adjustable range of brightness value is 0~100,Determine that the total current in rgb light source is 0.5A in the time that brightness value is 50. And then, calculate the size of current of each three primary light source.
The structure that shows the color configuration device of the disclosed a kind of atmosphere lamp of another embodiment of the present invention referring to Fig. 4 is shownIntention.
In the present embodiment, this device comprises: colouring information collecting unit 1, rgb value determining unit 2, RGB ratio-dependent unit3 and control module 4.
Wherein, colouring information collecting unit, the colouring information of choosing by operation interface for obtaining user.
Described colouring information at least comprises the kind of selected color.
Described rgb value determining unit, for according to the selective color setting in advance and the corresponding relation of RGB ratio, determinesThe rgb value of each selected color, described rgb value comprises R value, G value and B value.
It should be noted that, in the time that the RGT proportionate relationship to selective color arranges, need to adopt unified standard. ProtectCard, the summation of the rgb value of all selective colors all equates.
Described RGB ratio-dependent unit, for according to the rgb value of all described selected colors, calculates described colouring informationR value summation, G value summation and B value summation, to determine the RGB ratio of described colouring information.
Described control module, for according to the RGB ratio of described colouring information, controls rgb light source, completes colorConfiguration.
The structure that shows the color configuration device of the disclosed a kind of atmosphere lamp of another embodiment of the present invention referring to Fig. 5 is shownIntention.
Different from a upper embodiment, in the present embodiment, this device except comprise colouring information collecting unit 1,Outside rgb value determining unit 2, RGB ratio-dependent unit 3 and control module 4, also comprise for obtaining user and pass through operation interfaceThe monochrome information collecting unit 5 of the monochrome information of choosing.
In addition, described RGB ratio-dependent unit comprises in the present embodiment: the first computing module 31, the second computing module32, the 3rd computing module 33 and ratio-dependent module 34.
Wherein, described the first computing module is for the default formula of basisCalculate described colorThe R value summation of information.
Described the second computing module is for the default formula of basisCalculate described colouring informationG value summation.
Described the 3rd computing module is for the default formula of basisCalculate described colouring informationB value summation.
Wherein, M represents the kind of selected color, and N represents the number of times of choosing of selected color, and R_M represents the R of selected colorValue, G_M represents the G value of selected color, B_M represents the B value of selected color.
And then ratio-dependent module is determined the RGB ratio of described colouring information according to the output valve of above-mentioned three computing modulesExample.
Optionally, described control module comprises: the 4th computing module 41 and the first control module 42.
Wherein, described the 4th computing module, for according to the RGB ratio of described colouring information and described monochrome information, is countedCalculate each primary light source PWM dutycycle in described rgb light source.
Described the first control module is used for the PWM duty of each primary light source of utilizing the described rgb light source calculatingRatio, controls described rgb light source.
In a upper device embodiment, described control module realizes RGB by the PWM dutycycle of controlling RGB lamp sourceThe control in lamp source. It should be noted that, can be by controlling at control module described in other devices embodiment disclosed by the inventionThe electric current in RGB lamp source is controlled RGB lamp source.
Concrete, described control module comprises: the 5th computing module and the second control module.
Wherein, the 5th computing module, for according to the RGB ratio of described colouring information and described monochrome information, calculates instituteState the electric current of each primary light source in rgb light source;
Described the second control module is used for the electric current of each primary light source of utilizing the described rgb light source calculating, rightDescribed rgb light source is controlled.
It should be noted that this device embodiment is corresponding with embodiment of the method, its implementation is identical with execution principle,Therefore not to repeat here.
Finally, also it should be noted that, in this article, the relational terms such as the first and second grades be only used for byEntity or operation and another entity or operating space separate, and not necessarily require or imply these entities or operationBetween exist any this reality relation or order. And term " comprises ", " comprising " or its any other variant meaningContaining comprising of nonexcludability, thereby making to comprise that process, method, article or the equipment of a series of key elements not only comprise thatA little key elements, but also comprise other key elements of clearly not listing, or be also included as this process, method, article orThe key element that equipment is intrinsic. In the situation that there is no more restrictions, the key element being limited by statement " comprising ... ", does not arrangeExcept also having other identical element in the process of described key element, method, article or equipment comprising.
In this description, each embodiment adopts the mode of going forward one by one to describe, and what each embodiment stressed is and otherThe difference of embodiment, between each embodiment identical similar part mutually referring to.
To the above-mentioned explanation of the disclosed embodiments, make professional and technical personnel in the field can realize or use the present invention.To be apparent, as defined herein for those skilled in the art to the multiple amendment of these embodimentGeneral Principle can, in the situation that not departing from the spirit or scope of the present invention, realize in other embodiments. Therefore, the present inventionTo can not be restricted to these embodiment shown in this article, but will meet and principle disclosed herein and features of novelty phase oneThe widest scope causing.