Class: AsciidoctorDiagramLayout::Renderer::Scheme::GoldenRatioScheme
- Inherits:
-
Object
- Object
- AsciidoctorDiagramLayout::Renderer::Scheme::GoldenRatioScheme
- Defined in:
- lib/asciidoctor_diagram_layout/renderer/scheme/golden_ratio_scheme.rb
Constant Summary collapse
- GRADIENT_HUE_SHIFT =
20- STROKE_LIGHTNESS =
65- STROKE_SATURATION =
30
Instance Method Summary collapse
- #fill_color(name) ⇒ Object
- #gradient_end(name) ⇒ Object
-
#initialize(saturation, lightness) ⇒ GoldenRatioScheme
constructor
A new instance of GoldenRatioScheme.
- #stroke_color(name) ⇒ Object
Constructor Details
#initialize(saturation, lightness) ⇒ GoldenRatioScheme
Returns a new instance of GoldenRatioScheme.
9 10 11 12 |
# File 'lib/asciidoctor_diagram_layout/renderer/scheme/golden_ratio_scheme.rb', line 9 def initialize(saturation, lightness) @saturation = saturation @lightness = lightness end |
Instance Method Details
#fill_color(name) ⇒ Object
14 15 16 |
# File 'lib/asciidoctor_diagram_layout/renderer/scheme/golden_ratio_scheme.rb', line 14 def fill_color(name) ColorPalette.hsl_to_hex(hue(name), @saturation, @lightness) end |
#gradient_end(name) ⇒ Object
18 19 20 21 |
# File 'lib/asciidoctor_diagram_layout/renderer/scheme/golden_ratio_scheme.rb', line 18 def gradient_end(name) ColorPalette.hsl_to_hex((hue(name) + GRADIENT_HUE_SHIFT) % ColorPalette::HUE_RANGE, @saturation, @lightness) end |
#stroke_color(name) ⇒ Object
23 24 25 |
# File 'lib/asciidoctor_diagram_layout/renderer/scheme/golden_ratio_scheme.rb', line 23 def stroke_color(name) ColorPalette.hsl_to_hex(hue(name), STROKE_SATURATION, STROKE_LIGHTNESS) end |