Module: ColorContrastCalc::Converter::Saturate
- Defined in:
- lib/color_contrast_calc/converter.rb
Class Method Summary collapse
-
.calc_rgb(rgb, s) ⇒ Array<Integer>
Return a saturated RGB value of passed color.
Class Method Details
.calc_rgb(rgb, s) ⇒ Array<Integer>
Return a saturated RGB value of passed color.
The calculation is based on the definition found at www.w3.org/TR/filter-effects/#funcdef-saturate www.w3.org/TR/SVG/filters.html#feColorMatrixElement
146 147 148 |
# File 'lib/color_contrast_calc/converter.rb', line 146 def self.calc_rgb(rgb, s) Converter.rgb_map((calc_saturation(s) * Vector[*rgb]).to_a) end |