cmyk_rgb(C, M, Y, K)
This function convert CMYK to RGB
:param C: Cyan [0,1]
:type C:float
:param M: Magenta [0,1]
:type M:float
:param Y: Yellow [0,1]
:type Y:float
:param K: Black Key Color [0,1]
:type K:float
:return: RGB as list [R,G,B]
>>> cmyk_rgb(0,0,0,1)
[0, 0, 0]
>>> cmyk_rgb(1,0,0,0)
[0, 255, 255]
hex_rgb(hex_code)
This function convert hex_code to RGB
:param hex_code: hex_code input
:type hex_code:str
:return: RGB as list [R,G,B]
>>> hex_rgb('00FF00')
[0, 255, 0]
>>> hex_rgb('808080')
[128, 128, 128]
hsl_rgb(H, S, L)
This function convert hsl to rgb
:param H: Hue (0<=H<360)
:type H:int
:param S: Saturation (0<S<1)
:type S:float
:param L: Lightness (0<L<1)
:type L:float
:return: RGB as list [R,G,B]
>>> hsl_rgb(240,1,0.25)
[0, 0, 128]
>>> hsl_rgb(0,0,0.75)
[192, 192, 192]
hsv_rgb(H, S, V)
This function Convert HSV to RGB
:param H: Hue (0<=H<360)
:type H:int
:param S: Saturation (0<S<1)
:type S:float
:param V: Value (0<V<1)
:type V:float
:return: RGB as list [R,G,B]
>>> hsv_rgb(240,1,0.5)
[0, 0, 128]
>>> hsv_rgb(60,1,1)
[255, 255, 0]
rgb_cmyk(R, G, B)
This function convert RGB to CMYK
:param R: Red Color Code (0-255)
:type R:int
:param G: Green Color Code (0-255)
:type G:int
:param B: Blue Color Code (0-255)
:type B:int
:return: CMYK as list [C,M,Y,K]
>>> rgb_cmyk(0,0,255)
[1.0, 1.0, 0.0, 0.0]
>>> rgb_cmyk(0,255,255)
[1.0, 0.0, 0.0, 0.0]
rgb_hex(R, G, B)
This function convert RGB to HEX Format
:param R: Red Color Code (0-255)
:type R:int
:param G: Green Color Code (0-255)
:type G:int
:param B: Blue Color Code (0-255)
:type B:int
:return: hex code as string
>>> rgb_hex(0,0,0)
'000000'
>>> rgb_hex(192,192,192)
'C0C0C0'
>>> rgb_hex(0,128,0)
'008000'
rgb_hsl(R, G, B)
This function convert rgb to hsl
:param R: Red Color Code (0-255)
:type R:int
:param G: Green Color Code (0-255)
:type G:int
:param B: Blue Color Code (0-255)
:type B:int
:return: HSL as list [H,S,L]
>>> rgb_hsl(128,0,0)
[0, 1.0, 0.25]
>>> rgb_hsl(255,255,0)
[60, 1.0, 0.5]
rgb_hsv(R, G, B)
This function convert RGB to HSV
:param R: Red Color Code (0-255)
:type R:int
:param G: Green Color Code (0-255)
:type G:int
:param B: Blue Color Code (0-255)
:type B:int
:return: HSV as list [H,S,V]
>>> rgb_hsv(255,0,0)
[0, 1.0, 1.0]
>>> rgb_hsv(128,128,0)
[60, 1.0, 0.5]
zero_insert(i)
This function insert zero to input string
:param i: input string
:type i:int
:return: modified string
 
>>> zero_insert("2")
'02'
>>> zero_insert("02")
'02'