Class: CTioga::Themes::ClassicalTheme
- Includes:
- Tioga::FigureConstants
- Defined in:
- lib/CTioga/themes/classical.rb
Direct Known Subclasses
Constant Summary
Constants inherited from BaseTheme
Instance Attribute Summary collapse
-
#sets ⇒ Object
readonly
Mainly for listing purposes:.
Instance Method Summary collapse
- #choose_set(type, set) ⇒ Object
-
#initialize(color_set = 'standard', marker_set = 'standard', marker_color_set = :"=>color", linestyle_set = Line_Type_Solid) ⇒ ClassicalTheme
constructor
A new instance of ClassicalTheme.
- #next_curve_style(name) ⇒ Object
Methods inherited from BaseTheme
#bod_hook, #cmdline_extra_args, inherited
Constructor Details
#initialize(color_set = 'standard', marker_set = 'standard', marker_color_set = :"=>color", linestyle_set = Line_Type_Solid) ⇒ ClassicalTheme
Returns a new instance of ClassicalTheme.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/CTioga/themes/classical.rb', line 31 def initialize(color_set = 'standard', marker_set = 'standard', # By default, the marker color will match # the line color, even if the latter is set # manually. marker_color_set = :"=>color", linestyle_set = Line_Type_Solid) @sets = { :colors => MovingArray.new(Styles::COLORS, color_set), :markers => MovingArray.new(Styles::MARKERS, marker_set), :markers_colors => MovingArray.new(Styles::COLORS, marker_color_set), :linestyle => MovingArray.new(Styles::LINES, linestyle_set) } end |
Instance Attribute Details
#sets ⇒ Object (readonly)
Mainly for listing purposes:
29 30 31 |
# File 'lib/CTioga/themes/classical.rb', line 29 def sets @sets end |
Instance Method Details
#choose_set(type, set) ⇒ Object
60 61 62 |
# File 'lib/CTioga/themes/classical.rb', line 60 def choose_set(type, set) @sets[type].choose_current_set(set) end |
#next_curve_style(name) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/CTioga/themes/classical.rb', line 48 def next_curve_style(name) style = CurveStyle.new(@sets[:colors].value, @sets[:markers].value, @sets[:markers_colors].value, @sets[:linestyle].value, name, 1.0, false, # Does not interpolate by default 0.5) return style end |