class

String

Inherits Comparable / Reference / Object

String extension for color parsing

Instance methods

to_color

Convert string to color

Convenience method for parsing color strings. Supports hex colors, CSS color names, and CSS rgb/rgba functions.

"#FF0000".to_color        # => Red
"rgb(255, 0, 0)".to_color # => Red
"red".to_color            # => Red

See CrImage::Color.parse for full documentation.

Source