/* Title: CMYK-RGB These two functions convert CMYK values to RGB and vice versa. Function: rgb Converts RGB to CMYK. Parameters: c - cyan m - magenta y - yellow k - black Returns: An RGB value. Function: cmyk Converts CMYK to RGB. Parameters: r - red g - green b - blue s - seperator f - degree of accuracy (default: 3) Returns: A CMYK value. Notes: There will always be a slight loss in accuracy when making conversions. About: License - Version 1.2 by Titan . - Licenced under GNU GPL . */ rgb(c1, c2, c3, k, s = "") { kx := 1 - k, s := s ? s : ", " Loop, 3 l .= Round((1 - (c%A_Index% * kx + k)) * 255) . s Return, SubStr(l, 1, -StrLen(s)) } cmyk(r, g, b, s = "", f = 3) { k := c1 := 1 - r, c2 := 1 - g, c3 := 1 - b, s := s ? s : ", " ki := 1 - (k := c2 < k ? c2 : k, k := c3 < k ? c3 : k) Loop, 3 c .= Round((c%A_Index% - k) / ki, f) . s Return, c . Round(k, f) }