Module: Rubymine2Xcode::ColourConversion

Included in:
Converter
Defined in:
lib/rubymine2xcode-theme/rubymine.rb

Instance Method Summary collapse

Instance Method Details

#rubymine_colour_to_a(string) ⇒ Object



67
68
69
70
71
72
73
74
# File 'lib/rubymine2xcode-theme/rubymine.rb', line 67

def rubymine_colour_to_a string
  # rubymine colours have leading zeros stripped
  string = "0" * (6 - string.length) + string if string.length < 6
  red = string[0..1]
  green = string[2..3]
  blue = string[4..5]
  [red.to_i(16)/255.0, green.to_i(16)/255.0, blue.to_i(16)/255.0]
end