Module: ColorContrastCalc::Converter::HueRotate

Defined in:
lib/color_contrast_calc/converter.rb

Class Method Summary collapse

Class Method Details

.calc_rgb(rgb, deg) ⇒ Array<Integer>

Return a hue rotation applied RGB value of passed color.

The calculation is based on the definition found at https://www.w3.org/TR/filter-effects/#funcdef-hue-rotate https://www.w3.org/TR/SVG/filters.html#TransferFunctionElementAttributes



162
163
164
# File 'lib/color_contrast_calc/converter.rb', line 162

def self.calc_rgb(rgb, deg)
  Converter.rgb_map((calc_rotation(deg) * Vector[*rgb]).to_a)
end