Module: AsciidoctorDiagramLayout::Renderer::Scheme::ColorScheme
- Included in:
- AnalogousScheme, BwScheme, GoldenRatioScheme, MonochromaticScheme
- Defined in:
- lib/asciidoctor_diagram_layout/renderer/scheme/color_scheme.rb
Overview
Defines the duck-type contract for color scheme objects.
Every concrete scheme must include this module and override all three methods. Calling an unimplemented method raises NotImplementedError with the name of the offending class.
Instance Method Summary collapse
-
#fill_color(name) ⇒ String
Returns the base fill color for a named cell.
-
#gradient_end(name) ⇒ String
Returns the gradient endpoint color for a named cell.
-
#stroke_color(name) ⇒ String
Returns the stroke (border) color for a named cell.
Instance Method Details
#fill_color(name) ⇒ String
Returns the base fill color for a named cell.
29 30 31 |
# File 'lib/asciidoctor_diagram_layout/renderer/scheme/color_scheme.rb', line 29 def fill_color(name) raise NotImplementedError, "#{self.class} must implement #fill_color" end |
#gradient_end(name) ⇒ String
Returns the gradient endpoint color for a named cell.
When this equals #fill_color the gradient is imperceptible, producing a visually flat fill.
40 41 42 |
# File 'lib/asciidoctor_diagram_layout/renderer/scheme/color_scheme.rb', line 40 def gradient_end(name) raise NotImplementedError, "#{self.class} must implement #gradient_end" end |
#stroke_color(name) ⇒ String
Returns the stroke (border) color for a named cell.
48 49 50 |
# File 'lib/asciidoctor_diagram_layout/renderer/scheme/color_scheme.rb', line 48 def stroke_color(name) raise NotImplementedError, "#{self.class} must implement #stroke_color" end |