Method: Color::RGB#adjust_hue

Defined in:
lib/atome/utilities/color_helper/color/rgb.rb

#adjust_hue(percent) ⇒ Object

Returns a new colour with the hue adjusted by the specified percentage. Negative percentages will reduce the hue; positive percentages will increase the hue.

Color::RGB::DarkBlue.adjust_hue(10)
Color::RGB::DarkBlue.adjust_hue(-10)


327
328
329
330
331
332
# File 'lib/atome/utilities/color_helper/color/rgb.rb', line 327

def adjust_hue(percent)
  percent = normalize_percent(percent)
  hsl      = to_hsl
  hsl.h   *= percent
  hsl.to_rgb
end