Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/colorist/core_extensions.rb

Instance Method Summary collapse

Instance Method Details

#to_colorObject

Converts a CSS-style color string to a Color. Can be in the full form (\#112233), the abbreviated form (\#123) or a CSS named color ("black" or "maroon").



23
24
25
# File 'lib/colorist/core_extensions.rb', line 23

def to_color
  Colorist::Color.from_string(self)
end