Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/colorist/core_extensions.rb
Instance Method Summary collapse
-
#to_color ⇒ Object
Converts a CSS-style color string to a Color.
Instance Method Details
#to_color ⇒ Object
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 |