diff options
| author | Randy Morgan <[email protected]> | 2012-11-16 08:36:56 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-11-16 08:36:56 +0900 |
| commit | bffe05e5f218376843d0932e63f2e9f3db81d05a (patch) | |
| tree | 227d170e724caf0005cbbe275aa2df4a41d64b47 /lib | |
| parent | 3ead1acc36dc8c7a1fe8834972931b6213e6d140 (diff) | |
| download | caxlsx-bffe05e5f218376843d0932e63f2e9f3db81d05a.tar.gz caxlsx-bffe05e5f218376843d0932e63f2e9f3db81d05a.zip | |
Added sensible defaults for color scale
You can now use Axlsx::ColorScale.three_tone or
Axlsx::ColorScale.two_tone to create pretty conditional formatting.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/color_scale.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/axlsx/workbook/worksheet/color_scale.rb b/lib/axlsx/workbook/worksheet/color_scale.rb index cdeac099..9d1f47cf 100644 --- a/lib/axlsx/workbook/worksheet/color_scale.rb +++ b/lib/axlsx/workbook/worksheet/color_scale.rb @@ -9,8 +9,18 @@ module Axlsx class << self def default_cfvos - [{:type => :min, :val => 0, :color => 'FFFF0000'}, - {:type => :max, :val => 0, :color => 'FF0000FF'}] + [{:type => :min, :val => 0, :color => 'FFFF7128'}, + {:type => :max, :val => 0, :color => 'FFFFEF9C'}] + end + + def two_tone + self.new(*self.default_cfvos) + end + + def three_tone + self.new({:type => :min, :val => 0, :color => 'FFF8696B'}, + {:type => :percent, :val => '50', :color => 'FFFFEB84'}, + {:type => :max, :val => 0, :color => 'FF63BE7B'}) end end # A simple typed list of cfvos |
