Conversion formulas from RGB to CMYK
Hi,
I've been writing a Colour swatch tool (in excel! hell yeah!) which allows me to pick a bunch of colours, generate complimentary colours from them, blend between 2 colours in a set number of steps and a whole bunch of other cool stuff, and then output this as a photoshop or illustrator swatch file.
As part of this tool I want to be able to covert the rgb values to cmyk. There is very little information on this on the web and what there is is fairly inaccurate.
For example,
RGB:50,128,128
Converts to CMYK 61,0,0,50 (%) using the formula found at easyrgb.com (this formula is the most prevalent one on the web/web forums)
Photoshop converts these RGB values as CMYK: 80,33,48,8 (%)
While these two colour values are *similar* the ones generated by the easyrgb formulas are nowhere near the photoshop values.
See? stupid useless formulas. (I am aware of the differences and overlap of the two gamuts)

Whilst I know that the conversion done in photoshop is done using ICC templates, and that often these conversions are device dependant, there must be a more realiable way of converting from one colour space to another using good old reliable cold hard maths.
Does anyone know what that might be? you guys at Adobe: I AM LOOKING AT YOU.
Hope you guys can help,
~silvery~
For reference I have included and commented the easyrgb formulas:
First: RGB -> CMY
C = 1 - ( R / 255 )
M = 1 - ( G / 255 )
Y = 1 - ( B / 255 )
Second: CMY -> CMYK
var_K = 1
Initally sets var_K as 1, although this is dependant on variables below
if ( C < var_K ) var_K = C
if ( M < var_K ) var_K = M
if ( Y < var_K ) var_K = Y
This bit finds the smallest value from the CMY range and sets this value as var_K
if ( var_K == 1 ) { //Black
C = 0
M = 0
Y = 0
}
If var_K (the value that K is calculated from) is 1, then all the CMY values are reset to 0
else {
C = ( C - var_K ) / ( 1 - var_K )
M = ( M - var_K ) / ( 1 - var_K )
Y = ( Y - var_K ) / ( 1 - var_K )
If the value of var_K is anything other than 1 then use the smallest value from the CMY range
}
K = var_K
The value of K as filtered out from the conditions above
