Class: Nyaplot::Colors
- Inherits:
-
Object
- Object
- Nyaplot::Colors
- Defined in:
- lib/nyaplot/color.rb
Overview
The interface to access Colorbrewer through Nyaplot::Color
Class Method Summary collapse
-
.div(num) ⇒ Nyaplot::Color
A colorset randomly selected from diverging ones.
-
.lists ⇒ Array<String>
The list of names of prepared colorsets.
-
.qual(num) ⇒ Nyaplot::Color
A colorset randomly selected from qualitative ones.
-
.seq(num) ⇒ Nyaplot::Color
A colorset randomly selected from sequential ones.
Class Method Details
.div(num) ⇒ Nyaplot::Color
Returns A colorset randomly selected from diverging ones.
41 42 43 44 |
# File 'lib/nyaplot/color.rb', line 41 define_method(:div) {|num=nil| seq = color_set.select{|name, colors| colors["type"] == "div"} self.send(seq.keys.sample, num) } |
.lists ⇒ Array<String>
Returns the list of names of prepared colorsets.
22 |
# File 'lib/nyaplot/color.rb', line 22 define_method(:lists) {color_set.keys} |
.qual(num) ⇒ Nyaplot::Color
Returns A colorset randomly selected from qualitative ones.
34 35 36 37 |
# File 'lib/nyaplot/color.rb', line 34 define_method(:qual) {|num=nil| seq = color_set.select{|name, colors| colors["type"] == "qual"} self.send(seq.keys.sample, num) } |
.seq(num) ⇒ Nyaplot::Color
Returns A colorset randomly selected from sequential ones.
27 28 29 30 |
# File 'lib/nyaplot/color.rb', line 27 define_method(:seq) {|num=nil| seq = color_set.select{|name, colors| colors["type"] == "seq"} self.send(seq.keys.sample, num) } |