Class: Float

Inherits:
Object
  • Object
show all
Defined in:
lib/colorist/core_extensions.rb

Instance Method Summary collapse

Instance Method Details

#to_colorObject

Converts a number from 0.0 to 1.0 to the grayscale equivalent of that brightness value. Especially useful for adding percentages to a color.



14
15
16
# File 'lib/colorist/core_extensions.rb', line 14

def to_color
  Colorist::Color.from_rgb(self * 255, self * 255, self * 255)
end