Specific embodiment
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with the application specific embodiment and
Technical scheme is clearly and completely described in corresponding attached drawing.Obviously, described embodiment is only the application one
Section Example, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not doing
Every other embodiment obtained under the premise of creative work out, shall fall in the protection scope of this application.
Below in conjunction with attached drawing, the technical scheme provided by various embodiments of the present application will be described in detail.
Fig. 1 is the schematic flow chart of the generation method of the palette of one embodiment of the application.Method shown in FIG. 1
Executing subject can be, but not limited to mobile phone, computer and other intelligent terminals.Or the executing subject of method shown in FIG. 1 is also
It can be and be able to carry out client of this method itself, such as method shown in FIG. 1 is executed by the generating means of palette.
As shown in Figure 1, determining the mass-tone of palette at S102.
Palette by a series of there is certain representative basic color and their gradient color to form, and user is in palette
In can find the color of needs and obtain color value.
Producing principle based on palette can determine the mass-tone of toning analysis first.It should be pointed out that mixing colours determining
While the mass-tone of plate, the number (mass-tone number) of mass-tone can be determined simultaneously.
For example, user can choose a mass-tone as No. 5 colors.The specific color of mass-tone can be chosen by user.
At S104, number based on a specified passes through the determining ratio value corresponding with specified number of Bezier.
Specified number can be pre-set number.For example, pre-set number can be 1 to 9, wherein No. 5
Color is mass-tone.
Bezier realizes the smooth transition of curve, and the more, then curve transition is further smooth for the point on curve.
Specified number can be associated with ratio value by Bezier, as a result, number based on a specified, it can
To uniquely determine a corresponding ratio value by Bezier, thus number based on a specified, can more it is smooth really
Certainty ratio value.
For example, the corresponding ratio value determined can then seamlessly transit for number 1 to 9.
At S106, the size relation based on a specified numbered between the number of mass-tone determines blend color.
Mass-tone plate generally includes light-colored part and dark parts are total to two parts colour table.For light-colored part colour table, mainly
Mass-tone is mixed with white.For dark parts colour table, mainly mass-tone is mixed with black.Here white with
Black is blend color.
Herein, it should be pointed out that blend color is also possible to other colors, especially for dark parts colour table,
Blend color is not limited to black, can also generate blend color based on mass-tone.
It is further noted that typically, when specified number is less than or equal to the number of mass-tone, this is specified
Part be usually light-colored part colour table number, when specified number is greater than the number of mass-tone, the specified number is usual
For the number of dark parts colour table.Therefore, the size relation between number and the number of mass-tone based on a specified, can determine mixed
Close color.
For example, for the palette including number 1 to 9, No. 5 colors are mass-tone, then 1 to No. 4 is light-colored part colour table, 6 to 9
Number be dark parts colour table.
At S108, it is based on mass-tone, ratio value and blend color, generates palette.
Based on the brightness of the adjustable blend color of ratio value, then mass-tone and blend color adjusted are mixed
It closes, generates corresponding palette.
For each number on palette, ratio corresponding with the number specified can be determined by Bezier
Value, the characteristic based on Bezier, ratio value can number smooth transitions based on a specified;By ratio value, mass-tone and mix
After closing color generation palette, palette can have the characteristic of Bezier based on ratio value, make the transition of color range can more
Harmony, this is it is avoided that the form and aspect of depth part are imperfect in the palette that the superposition of equal proportion results in, especially dark color portion
The partially grey problem of the color divided.
In some embodiments, Bezier can be indicated by the polynomial form of Bornstein substrate of n rank, base
In practical application, the value of n can preferably be limited between 1 to 10 here, this implementation is not specific to the value work of n, n value
Size has no effect on the specific implementation of the present embodiment.
Fig. 2 is the schematic diagram that ratio value is determined by Bezier of one embodiment of the application.As shown in Fig. 2, figure
In Bezier can be drawn based on parameter 0.26,0.09,0.67,0.73.0.26 correspond to parameter ctx, 0.09
Correspond to parameter end corresponding to parameter start, 0.67,0.73 corresponds to parametric curvature.
For the above parameter, Bezier can be generated by such as minor function, it may be assumed that
*@param{CanvasRenderingContext2D}ctx;
*@param { Array<number>} start starting point;
*@param { Array<number>} end terminal;
*@param { number } curveness curvature (0-1);
*/function drawCurvePath(ctx,start,end,curveness){};
The horizontal axis coordinate of the Bezier of generation can indicate that the number of palette, ordinate of orthogonal axes can indicate and mix colours
Ratio value corresponding to the number of plate.
Based on Fig. 2 it is found that in number based on a specified, pass through the determining ratio corresponding with specified number of Bezier
It when value, based on a specified can number, determine the horizontal axis coordinate point in the two-dimensional coordinate system where Bezier;Based on horizontal axis
Coordinate points can be determined the ratio value on the longitudinal axis corresponding with horizontal axis coordinate point by Bezier.
Wherein, the distance between two numbers of arbitrary neighborhood are identical in Fig. 2.It is further noted that here
Horizontal axis and the longitudinal axis are in contrast, can to carry out the conversion on position based on the positional relationship of itself therebetween, such as can be with
Convert horizontal axis with the longitudinal axis for 90 degree of the two rotating Vortex, but this has no effect on the realization of the present embodiment.
Optionally, as an example, it is being based on horizontal axis coordinate point, is being determined by Bezier corresponding with horizontal axis coordinate point
The longitudinal axis on ratio value when, can be based on horizontal axis coordinate point, determine by horizontal axis coordinate point and perpendicular to the straight line of horizontal axis with
The intersection point of Bezier;Based on intersection point, ratio value corresponding with intersection point on the longitudinal axis can be determined in two-dimensional coordinate system.
Specifically, No. 6 colors in Fig. 2 are mass-tone, the corresponding ratio value of No. 1 color is 7.6%, indicates that No. 1 color subtracts light 93%;
The corresponding ratio value of No. 6 colors is 100%, indicates that mass-tone subtracts light 0%.
Optionally, as an example, when determining blend color, white can be determined as to the mixed of light-colored part colour table
Color is closed, i.e., when specified number is less than or equal to the number of mass-tone, white is determined as blend color.And for light portion
The blend color of color separation plate then can be adjusted mass-tone to form blend color, specifically, when specified number is greater than master
When the number of color, the color after mass-tone can be adjusted to HSB value is determined as blend color.
When being adjusted to mass-tone, it can be based on HSB model, corresponding form and aspect rotation is carried out to mass-tone and deepens brightness value
To generate blend color.The color of the palette obtained in this way, dark parts colour table will not be partially grey, can promote whole visual impression
Feel.
In HSB model, H indicates form and aspect (H, hue).In 0~360 ° of standard colour wheel, form and aspect are opsition dependent measurements.
It is such as red, green or orange common in use, form and aspect are identified by color designation.Black and white is without form and aspect.
S indicates the purity (S, saturation) of color, is grey when S is 0.White, black and other grey colors all do not have
Saturation degree.In maximum saturation, each form and aspect have most pure coloured light.S value range 0~100%.
B indicates brightness (B, brightness), is the brightness of color.As black when B is 0.Maximum brightness is color
Most distinct state.S value range 0~100%.
RGB represents the color in three channels of red, green, blue, the excessively variation to red (R), green (G), blue (B) three Color Channels
And the available miscellaneous color of their mutual superpositions.Therefore, any one mass-tone can pass through the shape of RGB
Formula is indicated.
Any one can indicate that form and aspect rotation is exactly on the three-dimensional space in three-dimensional space by the color that RGB is indicated
RGB point rotate a certain angle around by the perpendicular bisector of 3 points of planes constituted of RGB.
When being adjusted to mass-tone, can the cold and warm tone based on color corresponding form and aspect rotation is carried out to mass-tone and is deepened
Brightness value.Specifically, the form and aspect of mass-tone can be rotated to the first predetermined angle counterclockwise, and will lead when mass-tone is warm colour
The brightness value of color deepens the first preset ratio;When mass-tone is cool colour, the form and aspect of mass-tone are rotated clockwise into the second predetermined angle,
And the brightness value of mass-tone is deepened into the second preset ratio.
When mass-tone is different cold and warm tone, the above different strategy is executed to carry out corresponding form and aspect rotation to mass-tone
And deepen brightness value, it may be implemented to carry out targetedly form and aspect rotation to the most dark value of the mass-tone of cold-warm color, to be promoted
Color vision effect.
Wherein, the first predetermined angle can be 26 degree, and the first preset ratio can be 50%;Second predetermined angle can be
10 degree, the second preset ratio can be 55%.These values can make the B value maximum value in the HSB model of blend color, i.e. B
It is 100%.Wherein, B value is the optimal selection that maximum value is this implementation, and B value may be other different values, at this
Within the scope of the realization of embodiment.It should be pointed out that the above specific value be the present embodiment determines according to actual conditions
Preferred value, the present embodiment are not limited to the specific restriction to values above, and the first predetermined angle is also possible to the second predetermined angle
Others value, the first preset ratio and the second preset ratio are also possible to other values.
Bezier song is passed through for any mass-tone (including the customized arbitrary hue of user) for the palette of generation
Line and HSB model, an available more satisfied mass-tone color range, meet the needs of users.
It is above-mentioned that this specification specific embodiment is described.Other embodiments are in the scope of the appended claims
It is interior.In some cases, the movement recorded in detail in the claims or step can be come according to the sequence being different from embodiment
It executes and desired result still may be implemented.In addition, process depicted in the drawing not necessarily require show it is specific suitable
Sequence or consecutive order are just able to achieve desired result.In some embodiments, multitasking and parallel processing be also can
With or may be advantageous.
Below in conjunction with Fig. 3 detailed description according to the electronic equipment of one embodiment of the application.With reference to Fig. 3, in hardware
Level, electronic equipment include processor, optionally, including internal bus, network interface, memory.Wherein, memory may wrap
Containing memory, such as high-speed random access memory (Random-Access Memory, RAM), it is also possible to further include non-volatile
Memory (non-volatile memory), for example, at least 1 magnetic disk storage etc..Certainly, which is also possible that
Hardware required for other business.
Processor, network interface and memory can be connected with each other by internal bus, which can be industry
Standard architecture (Industry Standard Architecture, ISA) bus, Peripheral Component Interconnect standard
(Peripheral Component Interconnect, PCI) bus or expanding the industrial standard structure (Extended
Industry Standard Architecture, EISA) bus etc..The bus can be divided into address bus, data/address bus,
Control bus etc..Only to be indicated with a four-headed arrow in Fig. 3, it is not intended that an only bus or one kind convenient for indicating
The bus of type.
Memory, for storing program.Specifically, program may include program code, and said program code includes calculating
Machine operational order.Memory may include memory and nonvolatile memory, and provide instruction and data to processor.
Processor is from the then operation into memory of corresponding computer program is read in nonvolatile memory, in logical layer
The generating means of palette are formed on face.Processor executes the program that memory is stored, and is specifically used for executing following behaviour
Make:
Determine the mass-tone of palette;
Number based on a specified determines ratio value corresponding with the specified number by Bezier;
Based on the size relation between the specified number and the number of the mass-tone, blend color is determined;
Based on the mass-tone, the ratio value and the blend color, the palette is generated.
The generation method of palette disclosed in the above-mentioned embodiment illustrated in fig. 1 such as the application, can be applied in processor, or
Person is realized by processor.Processor may be a kind of IC chip, the processing capacity with signal.During realization,
Each step of the above method can be completed by the integrated logic circuit of the hardware in processor or the instruction of software form.On
The processor stated can be at general processor, including central processing unit (Central Processing Unit, CPU), network
Manage device (Network Processor, NP) etc.;Can also be digital signal processor (Digital Signal Processor,
DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate
Array (Field-Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or crystalline substance
Body pipe logical device, discrete hardware components.May be implemented or execute disclosed each method in the embodiment of the present application, step and
Logic diagram.General processor can be microprocessor or the processor is also possible to any conventional processor etc..In conjunction with
The step of method disclosed in the embodiment of the present application, can be embodied directly in hardware decoding processor and execute completion, or with decoding
Hardware and software module combination in processor execute completion.Software module can be located at random access memory, flash memory, read-only storage
In the storage medium of this fields such as device, programmable read only memory or electrically erasable programmable memory, register maturation.It should
The step of storage medium is located at memory, and processor reads the information in memory, completes the above method in conjunction with its hardware.
Certainly, other than software realization mode, other implementations are not precluded in the electronic equipment of the application, for example patrol
Collect device or the mode of software and hardware combining etc., that is to say, that the executing subject of following process flow is not limited to each patrol
Unit is collected, hardware or logical device are also possible to.
The embodiment of the present application also proposed a kind of computer readable storage medium, the computer-readable recording medium storage one
A or multiple programs, the one or more program include instruction, which holds when by the electronic equipment including multiple application programs
When row, the method that the electronic equipment can be made to execute embodiment illustrated in fig. 1, and be specifically used for executing following methods:
Determine the mass-tone of palette;
Number based on a specified determines ratio value corresponding with the specified number by Bezier;
Based on the size relation between the specified number and the number of the mass-tone, blend color is determined;
Based on the mass-tone, the ratio value and the blend color, the palette is generated.
Fig. 4 is the structural schematic diagram according to the generating means of the palette of one embodiment of the application.As shown in figure 4,
In a kind of Software Implementation, the generating means 400 of palette include:
Mass-tone determining module 420, for determining the mass-tone of palette;
Ratio value determining module 440 is used for number based on a specified, passes through Bezier determination and the specified volume
Number corresponding ratio value;
Color determination module 460, for based on the size relation between the specified number and the number of the mass-tone,
Determine blend color;
Generation module 480 generates the palette for being based on the mass-tone, the ratio value and the blend color.
The generating means of palette based on the present embodiment pass through Bezier song for each number on palette
Line can determine ratio value corresponding with the number specified, and the characteristic based on Bezier, ratio value can be based on a specified
Number smooth transition;After generating palette by ratio value, mass-tone and blend color, palette can have Bei Sai based on ratio value
The characteristic of your curve makes the transition of color range can be more harmonious, this is it is avoided that deep in the palette that the superposition of equal proportion results in
The form and aspect of superficial part point are imperfect, especially the partially grey problem of the color of dark parts.
Optionally, as one embodiment, ratio value determining module 440,
Based on the specified number, the horizontal axis coordinate point in the two-dimensional coordinate system where the Bezier is determined;
Based on the horizontal axis coordinate point, determined on the longitudinal axis corresponding with the horizontal axis coordinate point by the Bezier
Ratio value.
Optionally, as one embodiment, ratio value determining module 440,
Based on the horizontal axis coordinate point, determine by the horizontal axis coordinate point and perpendicular to the straight line of the horizontal axis with it is described
The intersection point of Bezier;
Based on the intersection point, ratio value corresponding with the intersection point on the longitudinal axis is determined in the two-dimensional coordinate system.
Optionally, as one embodiment, color determination module 460,
When the specified number is less than or equal to the number of the mass-tone, white is determined as blend color;
When the specified number is greater than the number of the mass-tone, the color after the mass-tone to be adjusted to HSB value is determined
For blend color.
Optionally, as one embodiment, color determination module 460,
Based on HSB model, corresponding form and aspect rotation is carried out to the mass-tone and deepens brightness value to generate the mixing face
Color.
Optionally, as one embodiment, color determination module 460,
When the mass-tone is warm colour, the form and aspect of the mass-tone are rotated into the first predetermined angle counterclockwise, and by the master
The brightness value of color deepens the first preset ratio;
When the mass-tone is cool colour, the form and aspect of the mass-tone are rotated clockwise into the second predetermined angle, and by the master
The brightness value of color deepens the second preset ratio.
Optionally, as one embodiment,
First predetermined angle is 26 degree, and first preset ratio is 50%;
Second predetermined angle is 10 degree, and second preset ratio is 55%.
Optionally, as one embodiment,
B value in the HSB model of the blend color is maximum value.
Optionally, as one embodiment, generation module 480
The brightness of the blend color is adjusted based on the ratio value;
The mass-tone is mixed with the blend color adjusted, generates corresponding palette.
Optionally, as one embodiment, the specified number is pre-set number.
The method that the generating means 400 of palette can also carry out embodiment illustrated in fig. 1, and realize the generating means of palette
The function of 400 embodiments shown in Fig. 1, details are not described herein for the embodiment of the present application.
In short, being not intended to limit the protection scope of the application the foregoing is merely the preferred embodiment of the application.
Within the spirit and principles of this application, any modification, equivalent replacement, improvement and so on should be included in the application's
Within protection scope.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.It is a kind of typically to realize that equipment is computer.Specifically, computer for example may be used
Think personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
It is any in device, navigation equipment, electronic mail equipment, game console, tablet computer, wearable device or these equipment
The combination of equipment.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices
Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including described want
There is also other identical elements in the process, method of element, commodity or equipment.
The above description is only an example of the present application, is not intended to limit this application.For those skilled in the art
For, various changes and changes are possible in this application.All any modifications made within the spirit and principles of the present application are equal
Replacement, improvement etc., should be included within the scope of the claims of this application.