Method: Sickill::Rainbow::AnsiRgb#code

Defined in:
lib/ansi_rgb.rb

#codeObject

Get the ANSI color code for this RGB color.



19
20
21
22
23
24
25
26
# File 'lib/ansi_rgb.rb', line 19

def code
  index = 16 +
          RGB.to_ansi_domain(@red) * 36 +
          RGB.to_ansi_domain(@green) * 6 +
          RGB.to_ansi_domain(@blue)

  "#{@ground_code};5;#{index}"
end