Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/chroma/extensions/string.rb

Instance Method Summary collapse

Instance Method Details

#paintChroma::Color

Creates Chroma::Color directly from a string representing a color.

Examples:

'red'.paint
'#f00'.paint
'#ff0000'.paint
'rgb(255, 0, 0)'.paint
'hsl(0, 100%, 50%)'.paint
'hsv(0, 100%, 100%)'.paint

Returns:



13
14
15
# File 'lib/chroma/extensions/string.rb', line 13

def paint
  Chroma.paint(self)
end