I fetch cmyk value for color and convert it into RGB and this RGB color is displayed in an html extension. But Color picker shows different values for RGB color due to which we get difference in color shades.i use normal java script method to convert CMYK to RGB.
Following formula that i used to convert CMYK to RGB--
CMYK to CMY
C = 1 - ( R / 255 )
M = 1 - ( G / 255 )
Y = 1 - ( B / 255 )
and then CMY TO RGB
R = ( 1 - C ) * 255
G = ( 1 - M ) * 255
B = ( 1 - Y ) * 255
Color picker shows different color as calculated from normal functions.
For eg : Color is Red.
In general
RGB : 255,0,0
CMYK : 0%,100%,100%,0%
HEXCODE : #FF0000
but in illustrator on double click of color picker it shows as
RGB : 237,28,36
CMYK : 0%,100%,100%,0%
HEXCODE : #ED1C24
So, is there any method or formula which can get the same values as calculated from the color picker .
Please Help ,thanks in advance.
please find attached image link for reference.
CMYK to RGB conversion:
The R,G,B values are given in the range of 0-255.
The red (R) color is calculated from the cyan (C) and black (K) colors:
R = 255 × (1-C) × (1-K)
The green color (G) is calculated from the magenta (M) and black (K) colors:
G = 255 × (1-M) × (1-K)
The blue color (B) is calculated from the yellow (Y) and black (K) colors:
B = 255 × (1-Y) × (1-K)