Class: Abachrome::Parsers::CSS
- Inherits:
-
Object
- Object
- Abachrome::Parsers::CSS
- Defined in:
- lib/abachrome/parsers/css.rb
Class Method Summary collapse
Class Method Details
.parse(input) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/abachrome/parsers/css.rb', line 22 def self.parse(input) return nil unless input.is_a?(String) input = input.strip.downcase # Try named colors first named_color = parse_named_color(input) return named_color if named_color # Try hex colors hex_color = Hex.parse(input) return hex_color if hex_color # Try functional notation parse_functional_color(input) end |