class String

Public Instance Methods

paint() click to toggle source

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

@example

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

@return [Chroma::Color]

# File lib/chroma/extensions/string.rb, line 13
def paint
  Chroma.paint(self)
end