This program makes 12 colors that are identical in tone and outputs them in the form of an image.
- input : s,v
- output : rgb image (see "Example Tone Equal Colors")
python3 colorPalette.py
HSV = H(Hue) + S(Saturation) + V(Valuness)
HSB = H(Hue) + S(Saturation) + B(Brightness)
- HSV and HSB is Same Color Space.
Converting RGB to HSV using Python needs "colorsys" library(Python provides us).
This implmetation is following.
import colorsys
colorsys.rgb_to_hsv(0.2, 0.4, 0.4) # out : (0.5, 0.5, 0.4)
colorsys.hsv_to_rgb(0.5, 0.5, 0.4) # out : (0.2, 0.4, 0.4)
- In Python, color space(RGB,HSV,etc) is defined in the range (0,1).
- In General, HSV consits of H(0,360°),S(0,100%),V(0,100%).
It is said that using colors that match in tone will create a sense of unity in the design. So, I define the color tone areas(T1 ~ T16) as shown in the following figure. Then, I use the value at the center of each region as the representative value, and the following figure shows the visualization of these values.
The following figure shows the results when the hue is changed by 30 degrees in a certain tone areas(T1 ~ T16). Once the tone is decided, a unified color scheme can be achieved by designing with these colors.The top left corner is 0 degrees, and each time you move next to it, the hue increases by 30 degrees.
PCSS defines tone like this
RGB to HSV Mathematics site