Module: LIFX::LAN::Colors
- Included in:
- Color
- Defined in:
- lib/lifx/lan/color.rb
Constant Summary collapse
- DEFAULT_KELVIN =
3500
Instance Method Summary collapse
-
#random_color(hue: rand(360), saturation: rand, brightness: rand, kelvin: DEFAULT_KELVIN) ⇒ Object
Helper to create a random Color.
-
#white(brightness: 1.0, kelvin: DEFAULT_KELVIN) ⇒ Color
Helper to create a white Color.
Instance Method Details
#random_color(hue: rand(360), saturation: rand, brightness: rand, kelvin: DEFAULT_KELVIN) ⇒ Object
Helper to create a random LIFX::LAN::Color
30 31 32 |
# File 'lib/lifx/lan/color.rb', line 30 def random_color(hue: rand(360), saturation: rand, brightness: rand, kelvin: DEFAULT_KELVIN) Color.new(hue, saturation, brightness, kelvin) end |
#white(brightness: 1.0, kelvin: DEFAULT_KELVIN) ⇒ Color
Helper to create a white LIFX::LAN::Color
25 26 27 |
# File 'lib/lifx/lan/color.rb', line 25 def white(brightness: 1.0, kelvin: DEFAULT_KELVIN) Color.new(0, 0, brightness, kelvin) end |