This application claims priority to Chinese Patent Application No. 201310622116.4 filed on Nov. 30, 2013, the contents of which are incorporated by reference herein.
The present disclosure relates to control systems, and particularly to a control system for controlling background colors of a mobile terminal.
User interfaces of mobile terminals can include a plurality of items, where each item is displayed on an interface with a background color.
The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the disclosure. Moreover, in the drawings, like reference numerals designate corresponding parts throughout the several views.
It will be appreciated that for simplicity and clarity of illustration, where appropriate, reference numerals have been repeated among the different figures to indicate corresponding or analogous elements. In addition, numerous specific details are set forth in order to provide a thorough understanding of the embodiments described herein. However, it will be understood by those of ordinary skill in the art that the embodiments described herein can be practiced without these specific details. In other instances, methods, procedures and components have not been described in detail so as not to obscure the related relevant feature being described. Also, the description is not to be considered as limiting the scope of the embodiments described herein. The drawings are not necessarily to scale and the proportions of certain parts have been exaggerated to better illustrate details and features of the present disclosure.
The term “comprising” means “including, but not necessarily limited to”; it specifically indicates open-ended inclusion or membership in a so-described combination, group, series and the like.
The present disclosure is described in relation to a control system and method for controlling background color. The control system includes a processor configured to execute instructions stored in a memory to: sample a plurality of pixels on a predetermined area during a predetermined interval; determine a main color among the sampled pixels, and determine a background color according to the main color. In at least one embodiment, the main color is a color that most sampled pixels have.
The control system 100 is applied to a mobile terminal 200 shown in
The first block 202, shown in
The coordinate defining module 111 creates a planar coordinate system 2024 shown in
The coordinate sampling module 112 samples the pixels of the item area 2021 on a predetermined sample area 2025. In at least one embodiment, the predetermined sample area 2025 is an area which has a smaller size than the size of the item area 2021. The coordinate sampling module 112 samples the pixels during a predetermined interval.
The first color calculating module 113 obtains red, green and blue (RGB) values of each pixel sampled by the coordinate sampling module 112.
The first tolerance value calculating module 114 calculates tolerance values of one of the sampled pixels with other sampled pixels. In at least one embodiment, the first tolerance value calculating module 114 randomly selects a sampled pixel P1(R1, G1, B1) of the sampled pixels, the values of R1, G1 and B1 are RGB values of P1. Then the first tolerance value calculating module 114 calculates tolerance value of P1 with other sampled pixels, for example P2(R2, G2, B2), the values of R2, G2 and B2 are RGB values of the sampled pixel P2. For example, if the RGB values of P1 are (33, 33, 43), and the RGB values of P2 are (31, 30, 48), the tolerance value t is t=max((33-31), (33-30))+max(|43-48|), then the tolerance value t is 8. After calculating the tolerance value of P1 with other sampled pixels, the first tolerance value calculating module 114 continue calculating the tolerance values of other randomly selected sampled pixels, except P1, with other sampled pixels.
The second color calculating module 115 calculates an amount of kinds of colors included in the sampled pixels, and an amount of sampled pixels included in each color, according to the tolerance values calculated by the first tolerance value calculating module 113. In at least one embodiment, the second color calculating module 115 determines whether the tolerance value t is smaller than a predetermined value, for example 10. If the tolerance value t is smaller than or equal to the predetermined value, the sampled pixel P1 is determined to have a same color as P2; otherwise, if the tolerance value t is larger than the predetermined value, the sampled pixel P1 is determined to have a different color as P2.
In one embodiment, if P1 is determined to have the same color as P2, the second color calculating module 115 continues to calculate the amount of sampled pixels which have a same color as P1. Then the second color calculating module 115 randomly selects a sampled pixel which is determined to have a different color as P1, for example P3, and counts the amount of pixels which have a same color as P3. According to this method, the second color calculating module 115 counts the amount of different colors included in the sampled pixels and the amount of sampled pixels included in each color.
In another embodiment, if the pixel P1 is determined to have a same color as P2, the second color calculating module 115 counts the amount of sampled pixels which have a same color as P1 as 2; otherwise, the amount of sampled pixels which have a same color as P1 and the amount of sampled pixels which have a same color as P2 are both counted as 1. Then the second color calculating module 115 randomly selects one sampled pixel, for example P3, and determines whether P3 has a same color as P1. If yes, the amount of sampled pixels which have a same color as P1 is added 1; if no, the amount of sampled pixels which have a same color as P3 is counted as 1, and the amount of sampled pixels which have a same color as P1 remains unchanged. According to this method, the second color calculating module 115 counts the amount of kinds of colors included in the sampled pixels, and the amount of sampled pixels included in each color.
The main color determining module 116 determines a main color according to the amount of kinds of colors included in the sampled pixels, and the amount of sampled pixels included in each color. In at least one embodiment, the main color determining module 116 determines a color that the most sampled pixels have, and then determines whether the determined color is a black color by comparing the RGB values of the determined color with (0, 0, 0), and determines whether the determined color is a white color by comparing the RGB values of the determined color with (255, 255, 255). If the determined color is determined as black or white, a gray color (128, 128, 128) is determined to be the main color; otherwise, if the determined color is determined not black nor white, the determined color is determined to be the main color.
The storage module 103 stores a color loop 1020 shown in
The second tolerance value calculating module 117 calculates tolerance values of the main color with each color shown in the color loop 1020.
The background color determining module 118 determines a background color according to the tolerance values calculated by the second tolerance value calculating module 117. In at least one embodiment, the background color determining module 118 determines which color shown in the color loop 1020 have the smallest tolerance value with the main color. Then the background color determining module 118 determines two colors which are adjacent to the determined color, and randomly select one of the two colors as the background color.
The background color filling module 119 fills the background area 2022 and the item name area 2023 with the background color, shown in
At block 301, a coordinate defining module creates a planar coordinate system when an item is displayed on an item area. In at least one embodiment, an origin of the planar coordinate system is one of vertexes of the item area. The X axis of the planar coordinate system is overlapped and extends along a first side of the item area, and the Y axis of the planar coordinate system is overlapped and extends along a second side which is adjacent to the first side of the item area.
At block 302, a coordinate sampling module samples pixels of the item area on a predetermined sample area. In at least one embodiment, the predetermined sample area is an area which has smaller size than the size of the item area. The coordinate sampling module samples the pixels during a predetermined interval.
At block 303, a first color calculating module obtains red, green and blue (RGB) values of each pixel sampled by the coordinate sampling module.
At block 304, a first tolerance value calculating module calculates tolerance values of one of the sampled pixels with other sampled pixels.
At block 305, a second color calculating module calculates an amount of kinds of colors included in the sampled pixels, and an amount of sampled pixels included in each color, according to the tolerance values calculated by the first tolerance value calculating module. In at least one embodiment, the second color calculating module determines whether the tolerance value t is smaller than a predetermined value, for example 10. If the tolerance value t is smaller than or equal to the predetermined value, the sampled pixel P1 is determined to have a same color as P2; otherwise, if the tolerance value t is larger than the predetermined value, the sampled pixel P1 is determined to have a different color as P2.
In one embodiment, if P1 is determined to have the same color as P2, the second color calculating module continues to calculate the amount of sampled pixels which have a same color as P1. Then the second color calculating module randomly selects a sampled pixel which is determined to have a different color as P1, for example P3, and counts the amount of pixels which have a same color as P3. According to this method, the second color calculating module counts the amount of kinds of colors included in the sampled pixels, and the amount of sampled pixels included in each color.
In another embodiment, if the pixel P1 is determined to have a same color as P2, the second color calculating module counts the amount of sampled pixels which have a same color as P1 as 2; otherwise, the amount of sampled pixels which have a same color as P1 and the amount of sampled pixels which have a same color as P2 are both counted as 1. Then the second color calculating module randomly selects one sampled pixel, for example P3, and determines whether P3 has a same color as P1. If yes, the amount of sampled pixels which have a same color as P1 is added 1; if no, the amount of sampled pixels which have a same color as P3 is counted as 1, and the amount of sampled pixels which have a same color as P1 remains unchanged. According to this method, the second color calculating module counts the amount of kinds of colors included in the sampled pixels, and the amount of sampled pixels included in each color.
At block 306, a main color determining module determines a main color according to the amount of kinds of colors included in the sampled pixels, and determines the amount of sampled pixels included in each color.
At block 307, a second tolerance value calculating module calculates tolerance values of the main color with each color shown in a color loop. The color loop can include a plurality of circles each of which is filled with a color, and the colors are different from each other. In at least one embodiment, the color loop can include a first color region, a second color region and a third color region. The first color region can include a first primary color and 6 gradually changing colors symmetrically arranged on two sides of the first primary color. The second color region can include a second primary color and 6 gradually changing colors symmetrically arranged on two sides of the second primary color. The third color region can include a third primary color and 6 gradually changing colors symmetrically arranged on two sides of the third primary color. The storage module also stores RGB values of each color in the color loop.
At block 308, a background color determining module determines a background color according to the tolerance values calculated by the second tolerance value calculating module. In at least one embodiment, the background color determining module determines which color shown in the color loop has the smallest tolerance value with the main color. Then the background color determining module determines two colors which are adjacent to the determined color, and randomly select one of the two colors as the background color.
At block 309, a background color filling module fills the background area and the item name area with the background color. The background color filling module also fills the item area with an item name of the item.
The embodiments shown and described above are only examples. Even though numerous characteristics and advantages of the present technology have been set forth in the foregoing description, together with details of the structure and function of the present disclosure, the disclosure is illustrative only, and changes may be made in the detail, including in matters of shape, size and arrangement of the parts within the principles of the present disclosure, up to and including the full extent established by the broad general meaning of the terms used in the claims.
Number | Date | Country | Kind |
---|---|---|---|
201310622116.4 | Nov 2013 | CN | national |