CN107102791B - Control color changing method and device - Google Patents

Control color changing method and device Download PDF

Info

Publication number
CN107102791B
CN107102791B CN201710209142.2A CN201710209142A CN107102791B CN 107102791 B CN107102791 B CN 107102791B CN 201710209142 A CN201710209142 A CN 201710209142A CN 107102791 B CN107102791 B CN 107102791B
Authority
CN
China
Prior art keywords
color
mode
component value
color component
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710209142.2A
Other languages
Chinese (zh)
Other versions
CN107102791A (en
Inventor
李华东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Kugou Computer Technology Co Ltd
Original Assignee
Guangzhou Kugou Computer Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Kugou Computer Technology Co Ltd
Priority to CN201710209142.2A priority Critical patent/CN107102791B/en
Publication of CN107102791A publication Critical patent/CN107102791A/en
Application granted granted Critical
Publication of CN107102791B publication Critical patent/CN107102791B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance

Abstract

The invention discloses a control color changing method and device, and belongs to the field of image processing. The method comprises the following steps: calculating the exposure corresponding to each color component value of the first color in the first color mode; correcting the color component value of the second color in the first color mode by using the exposure corresponding to the color component value of the first color of the same color component as the color component value of the second color in the first color mode to obtain a color component value of a third color of the same color component as the color component value of the second color in the first color mode; applying a third color to the target control. The problem that when a user changes the color of the interface, the color of the interface and the color of the control are uniform due to the fact that the control can be automatically changed into the color which is applied by the interface, and the operation of the user on the control can be interfered to a certain extent is solved; the effect that the user can distinguish the interface from the control on the interface conveniently is achieved while the sense of incongruity caused by color difference is reduced.

Description

Control color changing method and device
Technical Field
The invention relates to the field of image processing, in particular to a control color changing method and device.
Background
As different users have different color preferences, more and more applications support control color swapping.
To avoid the discomfort of color differences between the interface and the controls on the interface, when the user changes the color of the interface, the controls are automatically changed to the color that the interface is applying.
Although the above method can reduce the sense of incongruity caused by color difference, the operation of the user on the control can be disturbed to a certain extent due to the uniform color of the interface and the control.
Disclosure of Invention
In order to solve the problem that in the prior art, when a user changes the color of an interface, a control can be automatically changed into the color which is being applied to the interface, so that the colors of the interface and the control are uniform, and the operation of the user on the control can be interfered to a certain extent, the embodiment of the invention provides a method and a device for changing the color of the control. The technical scheme is as follows:
in a first aspect, a method for changing color of a control is provided, and the method includes:
respectively acquiring various color component values of a first color in a first color mode and various color component values of a second color in the first color mode, wherein the first color is a color which is applied to an object interface, and the second color is a color which replaces the first color;
calculating, according to each color component value of the first color in the first color mode, an exposure level corresponding to each color component value of the first color in the first color mode, respectively;
for each color component value of a second color in the first color mode, modifying the color component value of the second color in the first color mode with an exposure corresponding to the color component value of the first color of the same color component as the color component value of the second color in the first color mode to obtain a color component value of a third color of the same color component as the color component value of the second color in the first color mode;
applying the third color to a target control, the target control being located in the target interface.
In a second aspect, an apparatus for changing color of a control is provided, the apparatus comprising:
a first obtaining module, configured to obtain color component values of a first color in a first color mode and color component values of a second color in the first color mode, respectively, where the first color is a color in which a target interface is being applied, and the second color is a color that replaces the first color;
the calculating module is used for calculating exposure levels corresponding to the color component values of the first color in the first color mode according to the color component values of the first color in the first color mode;
a correction module, configured to, for each color component value of a second color in the first color mode, correct a color component value of the second color in the first color mode by using an exposure level corresponding to a color component value of the first color of the same color component as the color component value of the second color in the first color mode, so as to obtain a color component value of a third color of the same color component as the color component value of the second color in the first color mode;
and the application module is used for applying the third color to a target control, and the target control is positioned in the target interface.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
calculating exposure degrees corresponding to all color component values of colors applied by a target interface respectively, correcting all color component values of the colors applied by a replacement target interface by using the exposure degrees, and applying the colors corresponding to all color component values of the colors applied by the replacement target interface obtained after correction to a target control; therefore, the problem that when the user changes the color of the interface, the color of the interface and the color of the control are uniform, and the operation of the user on the control is interfered to a certain extent, because the control is automatically changed into the color which is applied by the interface, is solved; the effect that the user can distinguish the interface from the control on the interface conveniently is achieved while the sense of incongruity caused by color difference is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart of a method for changing color of a control according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for changing color of a control according to another embodiment of the present invention;
FIG. 3A is a block diagram illustrating an exemplary color-changing apparatus for a control according to an embodiment of the present invention;
fig. 3B is a block diagram illustrating a structure of a control color changing apparatus according to another embodiment of the present invention;
fig. 4 is a block diagram showing the structure of an electronic device provided in some embodiments of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of a method for changing color of a control according to an embodiment of the present invention is shown. The control color changing method can comprise the following steps:
step 101, obtaining color component values of a first color in a first color mode and color component values of a second color in the first color mode, respectively, where the first color is a color being applied to the object interface, and the second color is a color replacing the first color.
It should be noted that the first color mode may be an RGB color mode, an HSL color mode, an HSB color mode, an HSV color mode, etc., and the specific color mode of the first color mode is not limited in this embodiment.
When the first color mode is the RGB color mode, the color component values of the first color in the first color mode are a red value of the first color, a green value of the first color, and a blue value of the first color, respectively, and when the first color mode is the HSL color mode, the color component values of the first color in the first color mode are a hue value of the first color, a saturation value of the first color, and a brightness value of the first color, respectively.
Similarly, when the first color mode is the RGB color mode, the color component values of the second color in the first color mode are the red value of the second color, the green value of the second color, and the blue value of the second color, respectively, and when the first color mode is the HSL color mode, the color component values of the second color in the first color mode are the hue value of the second color, the saturation value of the second color, and the brightness value of the second color, respectively.
Step 102, calculating the exposure levels corresponding to the color component values of the first color in the first color mode according to the color component values of the first color in the first color mode.
Optionally, the terminal calculates the exposure levels corresponding to the color component values of the first color in the first color mode according to the calculation formulas related to the exposure levels and the color component values of the first color in the first color mode.
Wherein, the calculation formula related to the exposure is as follows:
P=pow((Q-a),b)=(Q-a)b
wherein P is an exposure level corresponding to each color component value of the first color in the first color mode, pow is a power function formula, Q is any one of the color component values of the first color in the first color mode, and a and b are both preset fixed values.
It should be noted that, since the value of Q ranges from 0 to 255, the value of a ranges from 0 to 255, for example, the value of a is 50.
It should be noted that the value of b ranges from 0 to 1, for example, the value of b is 0.88.
It should be noted that the values of a and b may be preset by a system or may be set manually, and the specific setting manner of the values of a and b is not limited in this embodiment.
For example, if the first color mode is the RGB color mode, the red value of the first color is 100, a is 75, and b is 0.5, then the exposure level corresponding to the red value of the first color is 5(P ═ 100-75)0.5)。
Step 103, for each color component value of the second color in the first color mode, modifying the color component value of the second color in the first color mode by using the exposure corresponding to the color component value of the first color of the same color component as the color component value of the second color in the first color mode, so as to obtain the color component value of the third color of the same color component as the color component value of the second color in the first color mode.
Specifically, for each color component value of the second color in the first color mode, the exposure level corresponding to the color component value of the first color of the same color component as the color component value of the second color in the first color mode is added to the color component value of the second color in the first color mode to obtain the color component value of the third color of the same color component as the color component value of the second color in the first color mode.
For example, if the first color pattern is RGB, the red value of the second color is 50, and the exposure level 5 corresponding to the red value calculated according to the red value of the first color is 5, then the red value of the third color is 55.
And 104, applying the third color to the target control, wherein the target control is positioned in the target interface.
And modifying the color component values of the second color in the first color mode by using the exposure to obtain a third color, namely the color after the target control is replaced.
To sum up, in the control color changing method provided in the embodiment of the present invention, exposure levels corresponding to color component values of a color being applied to the target interface are calculated, the exposure levels are used to correct the color component values of the color being applied to the replacement target interface, and a color corresponding to the color component values of the color being applied to the replacement target interface is applied to the target control, where the color being applied to the target control is obtained by correcting the color being applied to the replacement target interface, and the color is similar to the color being applied to the replacement target interface but has a color difference in hue; therefore, the problem that when the user changes the color of the interface, the color of the interface and the color of the control are uniform, and the operation of the user on the control is interfered to a certain extent, because the control is automatically changed into the color which is applied by the interface, is solved; the effect that the user can distinguish the interface from the control on the interface conveniently is achieved while the sense of incongruity caused by color difference is reduced.
In practical application, human eyes are very sensitive to light intensity and brightness, that is, besides manufacturing color differences between the interface and the controls on the interface, the brightness differences between the interface and the controls on the interface can also be manufactured, so that a user can distinguish the interface from the controls on the interface conveniently.
Referring to fig. 2, a flowchart of a method for changing color of a control according to another embodiment of the present invention is shown. The control color changing method can comprise the following steps:
step 201, obtaining color component values of a first color in a second color mode and color component values of a second color in the second color mode, respectively, where the first color is a color being applied to the target interface, and the second color is a color replacing the first color.
Step 202, converting each color component value of the first color in the second color mode into each color component value of the first color in the first color mode, and converting each color component value of the second color in the second color mode into each color component value of the second color in the first color mode, wherein the second color mode is different from the first color mode.
In the present embodiment, the second color mode is an RGB color mode, and the first color mode is an HSL color mode.
Optionally, an integer algorithm and/or a floating point algorithm is used to convert each color component value of the first color in the second color mode into each color component value of the first color in the first color mode, and convert each color component value of the second color in the second color mode into each color component value of the second color in the first color mode.
HSL is mathematically defined as the transformation of the coordinates of r, g, b in the RGB space for a color. Let (r, g, b) be the red, green and blue coordinates of a color, respectively, and the values of r, g, b are all real numbers from 0 to 1. Let max be the largest of r, g, and b. Min is set as the minimum value among r, g and b. Calculating the value of (h, s, l) of (r, g, b) in the HSL space, wherein h represents the hue angle of the angle, h has a value range of [0,360 ], s represents the saturation, s has a value range of [0,1], l represents the brightness, and l has a value range of [0,1], and the specific calculation process for converting (r, g, b) into (h, s, l) is as follows:
Figure BDA0001260597160000061
Figure BDA0001260597160000062
Figure BDA0001260597160000063
step 203, obtaining color component values of the first color in the first color mode and color component values of the second color in the first color mode respectively.
Step 204, calculating the exposure levels corresponding to the color component values of the first color in the first color mode according to the color component values of the first color in the first color mode.
Step 205, for each color component value of the second color in the first color mode, modifying the color component value of the second color in the first color mode by using the exposure corresponding to the color component value of the first color of the same color component as the color component value of the second color in the first color mode, so as to obtain the color component value of the third color of the same color component as the color component value of the second color in the first color mode.
It should be noted that, in this embodiment, the terminal may only correct the value of the color component l (i.e., brightness) of the second color in the first color mode (i.e., HSL color mode).
In step 206, each color component value of the third color in the first color mode is converted into each color component value of the third color in the second color mode.
Optionally, an integer algorithm and/or a floating point algorithm is used to convert each color component value of the third color in the first color mode into each color component value of the third color in the second color mode.
Defining a color C in HSL space, the coordinates of the color C are (h, s, l), wherein h represents the hue angle of an angle, the range of h is [0,360 ], s represents saturation, the range of s is [0,1], l represents brightness, the range of l is [0,1], setting (r, g, b) as the red coordinate, the green coordinate and the blue coordinate of a color respectively, and the values of r, g and b are real numbers from 0 to 1, and the specific calculation process of converting (h, s, l) into (r, g, b) is as follows:
first, if s is 0, the resulting color is achromatic or gray. In this particular case, r, g and b are all equal to l.
When s ≠ 0, the following procedure can be employed:
Figure BDA0001260597160000071
p=2×l-q
(h normalized to value range [0,1)
tG=hk
if tC<0→tC=tC+1.0 for each C∈{R,G,B}
if tC>1→tC=tC-1.0 for each C∈{R,G,B}
For each Color vector Color (ColorR, ColorG, ColorB) (r, g, b),
for each C ∈{R,G,B}
step 207, apply the third color to the target control, which is located in the target interface.
It should be noted that, in this embodiment, steps 203 to 205 are similar to steps 101 to 103, and step 207 is similar to step 104, so that the description of steps 203 to 205 and step 207 is not repeated in this embodiment.
To sum up, in the control color changing method provided in the embodiment of the present invention, exposure levels corresponding to color component values of a color being applied to the target interface are calculated, the exposure levels are used to correct the color component values of the color being applied to the replacement target interface, and a color corresponding to the color component values of the color being applied to the replacement target interface is applied to the target control, where the color being applied to the target control is obtained by correcting the color being applied to the replacement target interface, and the color is similar to the color being applied to the replacement target interface but has a color difference in hue; therefore, the problem that when the user changes the color of the interface, the color of the interface and the color of the control are uniform, and the operation of the user on the control is interfered to a certain extent, because the control is automatically changed into the color which is applied by the interface, is solved; the effect that the user can distinguish the interface from the control on the interface conveniently is achieved while the sense of incongruity caused by color difference is reduced.
In this embodiment, in addition to manufacturing the color difference between the interface and the control on the interface, the brightness difference between the interface and the control on the interface may also be manufactured to facilitate the user to distinguish the interface from the control on the interface.
The following are embodiments of the apparatus of the present invention, and for details not described in detail in the embodiments of the apparatus, reference may be made to the above-mentioned one-to-one corresponding method embodiments.
Referring to fig. 3A, fig. 3A is a block diagram illustrating a structure of a control color changing apparatus according to an embodiment of the present invention. The device includes: a first obtaining module 301, a calculating module 302, a correcting module 303 and an applying module 304.
A first obtaining module 301, configured to obtain color component values of a first color in a first color mode and color component values of a second color in the first color mode, where the first color is a color being applied to the target interface, and the second color is a color replacing the first color;
a calculating module 302, configured to calculate an exposure level corresponding to each color component value of the first color in the first color mode according to each color component value of the first color in the first color mode and each color component value of the second color in the first color mode;
a correcting module 303, configured to, for each color component value of the second color in the first color mode, correct the color component value of the second color in the first color mode by using an exposure level corresponding to the color component value of the first color of the same color component as the color component value of the second color in the first color mode, so as to obtain a color component value of a third color of the same color component as the color component value of the second color in the first color mode;
and an application module 304, configured to apply the third color to the target control, where the target control is located in the target interface.
Referring to fig. 3B, fig. 3B is a block diagram illustrating a structure of a control color changing apparatus according to another embodiment of the present invention. In a possible implementation manner, the calculating module 302 is further configured to: calculating the exposure levels respectively corresponding to the color component values of the first color in the first color mode according to the color component values of the first color in the first color mode and the calculation formula related to the exposure levels;
wherein, the calculation formula is:
P=pow((Q-a),b),
wherein P is an exposure level corresponding to each color component value of the first color in the first color mode, pow is a power function formula, L is any one of the color component values of the first color in the first color mode, and a and b are both preset fixed values. A
In a possible implementation manner, the modification module 303 is further configured to: for each color component value of the second color in the first color mode, adding the exposure level corresponding to the color component value of the first color of the same color component as the color component value of the second color in the first color mode to obtain a color component value of a third color of the same color component as the color component value of the second color in the first color mode.
In one possible implementation, the apparatus further includes: a second acquisition module 305, a first conversion module 306 and a second conversion module 307.
A second obtaining module 305 for obtaining respective color component values of the first color in the second color mode and respective color component values of the second color in the second color mode, respectively, before obtaining respective color component values of the first color in the first color mode and respective color component values of the second color in the first color mode, respectively;
a first conversion module 306, configured to convert each color component value of the first color in the second color mode into each color component value of the first color in the first color mode, and convert each color component value of the second color in the second color mode into each color component value of the second color in the first color mode, the second color mode being different from the color mode of the first color mode;
a second conversion module 307, configured to convert each color component value of the third color in the first color mode into each color component value of the third color in the second color mode before applying the third color to the target control.
In one possible implementation, the first conversion module 306 is further configured to: adopting an integer algorithm and/or a floating point algorithm to convert each color component value of the first color in the second color mode into each color component value of the first color in the first color mode, and converting each color component value of the second color in the second color mode into each color component value of the second color in the first color mode;
a second conversion module 307, further configured to: the respective color component values of the third color in the first color mode are converted into respective color component values of the third color in the second color mode using an integer algorithm and/or a floating point algorithm.
To sum up, in the control color changing apparatus provided in the embodiment of the present invention, exposure levels associated with color component values between a color being applied to the target interface and a color being applied to the replacement target interface are calculated, each color component value of the first color is modified by using the exposure levels, and colors corresponding to the modified color component values are applied to the target control; therefore, the problem that when the user changes the color of the interface, the color of the interface and the color of the control are uniform, and the operation of the user on the control is interfered to a certain extent, because the control is automatically changed into the color which is applied by the interface, is solved; the effect that the user can distinguish the interface from the control on the interface conveniently is achieved while the sense of incongruity caused by color difference is reduced.
In this embodiment, in addition to manufacturing the color difference between the interface and the control on the interface, the brightness difference between the interface and the control on the interface may also be manufactured to facilitate the user to distinguish the interface from the control on the interface.
It should be noted that: the control color changing device provided in the above embodiment only exemplifies the division of the above functional modules when changing the color of the control, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the electronic device is divided into different functional modules to complete all or part of the functions described above. In addition, the control color changing device and the control color changing method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Referring to fig. 4, a block diagram of an electronic device provided in some embodiments of the invention is shown. The electronic device 400 is used for implementing the control color changing method provided by the above embodiment. The electronic device 400 of the present invention may include one or more of the following components: a processor for executing computer program instructions to perform the various processes and methods, Random Access Memory (RAM) and Read Only Memory (ROM) for information and storing program instructions, memory for storing data and information, I/O devices, interfaces, antennas, and the like. Specifically, the method comprises the following steps:
the electronic device 400 may include RF (Radio Frequency) circuitry 410, a memory 420, an input unit 430, a display unit 440, a sensor 450, an audio circuit 460, a WiFi (wireless fidelity) module 470, a processor 480, a power supply 482, a camera 490, and the like. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 4 does not constitute a limitation of the terminal, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes the components of the electronic device 400 in detail with reference to fig. 4:
the RF circuit 410 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information of a base station and then processes the received downlink information to the processor 480; in addition, the data for designing uplink is transmitted to the base station. Typically, the RF circuitry includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, an LNA (low noise amplifier), a duplexer, and the like. In addition, the RF circuitry 410 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (short messaging Service), and the like.
The memory 420 may be used to store software programs and modules, and the processor 480 executes various functional applications and data processing of the electronic device 400 by operating the software programs and modules stored in the memory 420. The memory 420 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the electronic device 400, and the like. Further, the memory 420 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 430 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device 400. Specifically, the input unit 430 may include a touch panel 431 and other input devices 432. The touch panel 431, also called a touch screen, may collect touch operations of a user on or near the touch panel 431 (e.g., operations of the user on or near the touch panel 431 using any suitable object or accessory such as a finger or a stylus) and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 431 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 480, and receives and executes commands sent from the processor 480. In addition, the touch panel 431 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 430 may include other input devices 432 in addition to the touch panel 431. In particular, other input devices 432 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 440 may be used to display information input by or provided to the user and various menus of the electronic device 400. The display unit 440 may include a display panel 441, and optionally, the display panel 441 may be configured in the form of an LCD (Liquid crystal display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch panel 431 may cover the display panel 441, and when the touch panel 431 detects a touch operation on or near the touch panel 431, the touch panel is transmitted to the processor 480 to determine the type of the touch event, and then the processor 480 provides a corresponding visual output on the display panel 441 according to the type of the touch event. Although in fig. 4, the touch panel 431 and the display panel 441 are two separate components to implement the input and output functions of the electronic device 400, in some embodiments, the touch panel 431 and the display panel 441 may be integrated to implement the input and output functions of the electronic device 400.
The electronic device 400 may also include at least one sensor 450, such as a gyroscope sensor, a magnetic induction sensor, an optical sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 441 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 441 and/or the backlight when the electronic device 400 is moved to the ear. As one type of motion sensor, the acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration) for recognizing the attitude of electronic equipment, and related functions (such as pedometer and tapping) for vibration recognition; as for other sensors such as barometer, hygrometer, thermometer, infrared sensor, etc. that can be configured in the electronic device 400, they are not described in detail herein.
The audio circuit 460, speaker 461, microphone 462 may provide an audio interface between a user and the electronic device 400. The audio circuit 460 may transmit the electrical signal converted from the received audio data to the speaker 461, and convert the electrical signal into a sound signal for output by the speaker 461; on the other hand, the microphone 462 converts the collected sound signal into an electric signal, which is received by the audio circuit 460 and converted into audio data, which is then processed by the audio data output processor 480, and then transmitted to, for example, another terminal via the RF circuit 410, or output to the memory 420 for further processing.
WiFi belongs to short-range wireless transmission technology, and the electronic device 400 can help the user send and receive e-mails, browse web pages, access streaming media, etc. through the WiFi module 470, which provides the user with wireless broadband internet access. Although fig. 4 shows the WiFi module 470, it is understood that it does not belong to the essential constitution of the electronic device 400, and may be omitted entirely as needed within the scope not changing the essence of the disclosure.
The processor 480 is a control center of the electronic device 400, connects various parts of the entire electronic device using various interfaces and lines, performs various functions of the electronic device 400 and processes data by operating or executing software programs and/or modules stored in the memory 420 and calling data stored in the memory 420, thereby monitoring the electronic device as a whole. Optionally, processor 480 may include one or more processing units; preferably, the processor 480 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 480.
The electronic device 400 also includes a power supply 482 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 482 via a power management system to provide management of charging, discharging, and power consumption via the power management system.
The camera 490 is generally composed of a lens, an image sensor, an interface, a digital signal processor, a CPU, a display screen, and the like. The lens is fixed above the image sensor, and the focusing can be changed by manually adjusting the lens; the image sensor is equivalent to the 'film' of a traditional camera and is the heart of a camera for acquiring images; the interface is used for connecting the camera with the main board of the electronic equipment by using a flat cable, a board-to-board connector and a spring type connection mode, and sending the acquired image to the memory 420; the digital signal processor processes the acquired image through a mathematical operation, converts the acquired analog image into a digital image, and transmits the digital image to the memory 420 through an interface.
Although not shown, the electronic device 400 may further include a bluetooth module or the like, which is not described in detail herein.
In addition to the one or more processors 480, the electronic device 400 includes memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors. The one or more programs have the following functions:
the above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A method for changing color of a control, the method comprising:
respectively acquiring various color component values of a first color in a first color mode and various color component values of a second color in the first color mode, wherein the first color is a color which is applied to an object interface, and the second color is a color which replaces the first color;
calculating, according to each color component value of the first color in the first color mode, an exposure level corresponding to each color component value of the first color in the first color mode, respectively;
for each color component value of a second color in the first color mode, modifying the color component value of the second color in the first color mode with an exposure corresponding to the color component value of the first color of the same color component as the color component value of the second color in the first color mode to obtain a color component value of a third color of the same color component as the color component value of the second color in the first color mode;
applying the third color to a target control, the target control being located in the target interface.
2. The method according to claim 1, wherein said calculating the respective exposures for the respective color component values of the first color in the first color mode based on the respective color component values of the first color in the first color mode comprises:
calculating the exposure levels respectively corresponding to the color component values of the first color in the first color mode according to the calculation formulas related to the exposure levels and the color component values of the first color in the first color mode;
wherein the calculation formula is as follows:
P=pow((Q-a),b),
wherein P is an exposure level corresponding to each color component value of the first color in the first color mode, pow is a power function formula, Q is any one of the color component values of the first color in the first color mode, and a and b are both preset fixed values.
3. The method according to claim 1, wherein said modifying the color component value of the second color in the first color mode with an exposure level corresponding to the color component value of the first color of the same color component as the color component value of the second color in the first color mode for each color component value of the second color in the first color mode to obtain a color component value of a third color of the same color component as the color component value of the second color in the first color mode comprises:
for each color component value of a second color in the first color mode, adding an exposure level corresponding to a color component value of the first color of the same color component as the color component value of the second color in the first color mode to obtain a color component value of a third color of the same color component as the color component value of the second color in the first color mode.
4. The method according to any one of claims 1 to 3, wherein before said separately acquiring each color component value of the first color in the first color mode and each color component value of the second color in the first color mode, the method further comprises:
acquiring color component values of the first color in a second color mode and color component values of the second color in the second color mode respectively;
converting each color component value of the first color in the second color scheme into each color component value of the first color in the first color scheme, converting each color component value of the second color in the second color scheme into each color component value of the second color in the first color scheme, the second color scheme being different from the color scheme of the first color scheme;
prior to said applying the third color to the target control, the method further comprises:
converting each color component value of the third color in the first color mode into each color component value of the third color in the second color mode.
5. The method according to claim 4, wherein said converting each color component value of said first color in said second color mode to each color component value of said first color in said first color mode and said converting each color component value of said second color in said second color mode to each color component value of said second color in said first color mode comprises:
converting each color component value of the first color in the second color mode to each color component value of the first color in the first color mode using an integer algorithm and/or a floating point algorithm, converting each color component value of the second color in the second color mode to each color component value of the second color in the first color mode;
said converting each color component value of said third color in said first color mode to each color component value of said third color in said second color mode comprises:
converting each color component value of the third color in the first color mode to each color component value of the third color in the second color mode using the integer algorithm and/or the floating point algorithm.
6. An apparatus for changing color of a control, the apparatus comprising:
a first obtaining module, configured to obtain color component values of a first color in a first color mode and color component values of a second color in the first color mode, respectively, where the first color is a color in which a target interface is being applied, and the second color is a color that replaces the first color;
the calculating module is used for calculating exposure levels corresponding to the color component values of the first color in the first color mode according to the color component values of the first color in the first color mode;
a correction module, configured to, for each color component value of a second color in the first color mode, correct a color component value of the second color in the first color mode by using an exposure level corresponding to a color component value of the first color of the same color component as the color component value of the second color in the first color mode, so as to obtain a color component value of a third color of the same color component as the color component value of the second color in the first color mode;
and the application module is used for applying the third color to a target control, and the target control is positioned in the target interface.
7. The apparatus of claim 6, wherein the computing module is further configured to: calculating the exposure levels respectively corresponding to the color component values of the first color in the first color mode according to the calculation formulas related to the exposure levels and the color component values of the first color in the first color mode;
wherein the calculation formula is as follows:
P=pow((Q-a),b),
wherein P is an exposure level corresponding to each color component value of the first color in the first color mode, pow is a power function formula, Q is any one of the color component values of the first color in the first color mode, and a and b are both preset fixed values.
8. The apparatus of claim 6, wherein the modification module is further configured to: for each color component value of the second color in the first color mode, adding an exposure level corresponding to a color component value of the first color of the same color component as the color component value of the second color in the first color mode to obtain a color component value of a third color of the same color component as the color component value of the second color in the first color mode.
9. The apparatus according to any one of claims 6-8, wherein the apparatus further comprises:
a second obtaining module, configured to obtain respective color component values of the first color in a second color mode and respective color component values of the second color in the second color mode before the obtaining of the respective color component values of the first color in the first color mode and the respective color component values of the second color in the first color mode, respectively;
a first conversion module configured to convert each color component value of the first color in the second color mode into each color component value of the first color in the first color mode, and convert each color component value of the second color in the second color mode into each color component value of the second color in the first color mode, the second color mode being different from the first color mode;
a second conversion module for converting each color component value of said third color in said first color mode to each color component value of said third color in said second color mode prior to said applying said third color to the target control.
10. The apparatus of claim 9, wherein the first conversion module is further configured to:
converting each color component value of the first color in the second color mode to each color component value of the first color in the first color mode using an integer algorithm and/or a floating point algorithm, converting each color component value of the second color in the second color mode to each color component value of the second color in the first color mode;
the second conversion module is further configured to: converting each color component value of the third color in the first color mode to each color component value of the third color in the second color mode using the integer algorithm and/or the floating point algorithm.
CN201710209142.2A 2017-03-31 2017-03-31 Control color changing method and device Active CN107102791B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710209142.2A CN107102791B (en) 2017-03-31 2017-03-31 Control color changing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710209142.2A CN107102791B (en) 2017-03-31 2017-03-31 Control color changing method and device

Publications (2)

Publication Number Publication Date
CN107102791A CN107102791A (en) 2017-08-29
CN107102791B true CN107102791B (en) 2020-01-14

Family

ID=59676226

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710209142.2A Active CN107102791B (en) 2017-03-31 2017-03-31 Control color changing method and device

Country Status (1)

Country Link
CN (1) CN107102791B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704052B (en) * 2018-07-10 2022-02-08 腾讯科技(深圳)有限公司 Service platform color configuration method and device, storage medium and electronic device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1479994A (en) * 2001-10-11 2004-03-03 ������������ʽ���� Colour coverting device and colour converting method
JP2005051593A (en) * 2003-07-30 2005-02-24 Olympus Corp Camera
JP2005204095A (en) * 2004-01-16 2005-07-28 Sanyo Electric Co Ltd Exposure control apparatus
CN1812481A (en) * 2005-01-27 2006-08-02 佳能株式会社 Image processing apparatus and its method
CN103314572A (en) * 2010-07-26 2013-09-18 新加坡科技研究局 Method and device for image processing
CN105812674A (en) * 2014-12-29 2016-07-27 浙江大华技术股份有限公司 Signal lamp color correction method, monitoring method, and device thereof

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1479994A (en) * 2001-10-11 2004-03-03 ������������ʽ���� Colour coverting device and colour converting method
JP2005051593A (en) * 2003-07-30 2005-02-24 Olympus Corp Camera
JP2005204095A (en) * 2004-01-16 2005-07-28 Sanyo Electric Co Ltd Exposure control apparatus
CN1812481A (en) * 2005-01-27 2006-08-02 佳能株式会社 Image processing apparatus and its method
CN103314572A (en) * 2010-07-26 2013-09-18 新加坡科技研究局 Method and device for image processing
CN105812674A (en) * 2014-12-29 2016-07-27 浙江大华技术股份有限公司 Signal lamp color correction method, monitoring method, and device thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种色彩校正算法研究与实现;孙茜雅;《电子科技》;20140331;第27卷(第3期);全文 *

Also Published As

Publication number Publication date
CN107102791A (en) 2017-08-29

Similar Documents

Publication Publication Date Title
CN107038681B (en) Image blurring method and device, computer readable storage medium and computer device
CN108257581B (en) Light intensity detection device, mobile terminal and display screen brightness adjustment method
EP3370204A1 (en) Method for detecting skin region and device for detecting skin region
CN111179861B (en) Brightness calibration method and device, storage medium and terminal
CN109688322B (en) Method and device for generating high dynamic range image and mobile terminal
CN109361867B (en) Filter processing method and mobile terminal
CN110602473A (en) White balance calibration method and device
CN107819935B (en) Control method of mobile terminal and mobile terminal
CN109151367B (en) Video call method and terminal equipment
CN110266323B (en) Signal control circuit, terminal equipment and signal control method
CN108040209B (en) Shooting method and mobile terminal
CN109462745B (en) White balance processing method and mobile terminal
CN109727212B (en) Image processing method and mobile terminal
CN112532958B (en) Image processing method, device, electronic equipment and readable storage medium
CN108494936B (en) Light intensity detection method and mobile terminal
CN109343811B (en) Display adjustment method and terminal equipment
CN109041190B (en) Power control method and terminal
CN113888447A (en) Image processing method, terminal and storage medium
CN110730013B (en) Method for improving transmission stray and mobile terminal
AU2018302985A1 (en) Method and mobile terminal for processing image and storage medium
CN107102791B (en) Control color changing method and device
CN109286414B (en) Antenna determination method and terminal
CN109348212B (en) Image noise determination method and terminal equipment
CN111328132A (en) Method for adjusting transmitting power and electronic equipment
CN110168599B (en) Data processing method and terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 510660 Guangzhou City, Guangzhou, Guangdong, Whampoa Avenue, No. 315, self - made 1-17

Applicant after: Guangzhou KuGou Networks Co., Ltd.

Address before: 510000 B1, building, No. 16, rhyme Road, Guangzhou, Guangdong, China 13F

Applicant before: Guangzhou KuGou Networks Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant