--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Converts the RGB colour to CMYK. Most colour experts strongly suggest that this is not a good idea (some even suggesting that it's a very bad idea). CMYK represents additive percentages of inks on white paper, whereas RGB represents mixed colour intensities on a black screen.
- !ruby/struct:SM::Flow::P 
  body: "However, the colour conversion can be done. The basic method is multi-step:"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "1."
    body: Convert the R, G, and B components to C, M, and Y components.
  - !ruby/struct:SM::Flow::VERB 
    body: " c = 1.0 - r\n m = 1.0 - g\n y = 1.0 - b\n"
  - !ruby/struct:SM::Flow::LI 
    label: "2."
    body: Compute the minimum amount of black (K) required to smooth the colour in inks.
  - !ruby/struct:SM::Flow::VERB 
    body: " k = min(c, m, y)\n"
  - !ruby/struct:SM::Flow::LI 
    label: "3."
    body: Perform undercolour removal on the C, M, and Y components of the colours because less of each colour is needed for each bit of black. Also, regenerate the black (K) based on the undercolour removal so that the colour is more accurately represented in ink.
  - !ruby/struct:SM::Flow::VERB 
    body: " c = min(1.0, max(0.0, c - UCR(k)))\n m = min(1.0, max(0.0, m - UCR(k)))\n y = min(1.0, max(0.0, y - UCR(k)))\n k = min(1.0, max(0.0, BG(k)))\n"
  type: :NUMBER
- !ruby/struct:SM::Flow::P 
  body: The undercolour removal function and the black generation functions return a value based on the brightness of the RGB colour.
full_name: Color::RGB#to_cmyk
is_singleton: false
name: to_cmyk
params: ()
visibility: public
