Module: ColorContrastCalc::Color::List
- Defined in:
- lib/color_contrast_calc/color.rb
Overview
Provide predefined lists of Color instances.
Constant Summary collapse
- NAMED_COLORS =
Predefined list of named colors.
You can find the color names at www.w3.org/TR/SVG/types.html#ColorKeywords
keywords.map {|name, hex| Color.new(hex, name) }.freeze
- WEB_SAFE_COLORS =
Predefined list of web safe colors.
generate_web_safe_colors.freeze
Class Method Summary collapse
-
.hsl_colors(s: 100, l: 50, h_interval: 1) ⇒ Array<Color>
Return a list of colors which share the same saturation and lightness.
Class Method Details
.hsl_colors(s: 100, l: 50, h_interval: 1) ⇒ Array<Color>
Return a list of colors which share the same saturation and lightness.
By default, so-called pure colors are returned.
546 547 548 |
# File 'lib/color_contrast_calc/color.rb', line 546 def self.hsl_colors(s: 100, l: 50, h_interval: 1) 0.step(360, h_interval).map {|h| Color.from_hsl([h, s, l]) }.freeze end |