Class: Nyaplot::Colors

Inherits:
Object
  • Object
show all
Defined in:
lib/nyaplot/color.rb

Overview

The interface to access Colorbrewer through Nyaplot::Color

Class Method Summary collapse

Class Method Details

.div(num) ⇒ Nyaplot::Color


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)
}

.listsArray<String>


22
# File 'lib/nyaplot/color.rb', line 22

define_method(:lists) {color_set.keys}

.qual(num) ⇒ Nyaplot::Color


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


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)
}