Class: Graphics::Greyscale

Inherits:
Rainbow
  • Object
show all
Defined in:
lib/graphics/rainbows.rb

Overview

Black to white gradient

Instance Attribute Summary

Attributes inherited from Rainbow

#cache

Instance Method Summary collapse

Methods inherited from Rainbow

#cache_colors, #clamp, #color, #initialize, #scale

Constructor Details

This class inherits a constructor from Graphics::Rainbow

Instance Method Details

#_color(degree) ⇒ Object

:nodoc:



52
53
54
55
56
57
# File 'lib/graphics/rainbows.rb', line 52

def _color degree # :nodoc:
  brightness_unit = degree/360.0
  brightness = (brightness_unit*255.0).floor # Scale back to RGB

  [brightness, brightness, brightness]
end