diff options
| author | Randy Morgan (@morgan_randy) <[email protected]> | 2013-06-08 10:03:39 -0700 |
|---|---|---|
| committer | Randy Morgan (@morgan_randy) <[email protected]> | 2013-06-08 10:03:39 -0700 |
| commit | 00cb09391927aaea08de304f3faad3afdbff2b18 (patch) | |
| tree | 9b81e7c9ed0d6e2a6a25838684a6af51068dcfbb /lib | |
| parent | 7caf2ea9dfe92fa418f40132ea3c94d3da109f2c (diff) | |
| parent | e23558c0bd7bb9027c8ce872ca2b08089b7d1c78 (diff) | |
| download | caxlsx-00cb09391927aaea08de304f3faad3afdbff2b18.tar.gz caxlsx-00cb09391927aaea08de304f3faad3afdbff2b18.zip | |
Merge pull request #190 from amalagaura/patch-1
Update bg_color in conditional formatting
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/stylesheet/styles.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb index 8cd2275c..44ccb752 100644 --- a/lib/axlsx/stylesheet/styles.rb +++ b/lib/axlsx/stylesheet/styles.rb @@ -296,9 +296,11 @@ module Axlsx def parse_fill_options(options={}) return unless options[:bg_color] color = Color.new(:rgb=>options[:bg_color]) - pattern = PatternFill.new(:patternType =>:solid, :fgColor=>color) + dxf = options[:type] == :dxf + color_key = dxf ? :bgColor : :fgColor + pattern = PatternFill.new(:patternType =>:solid, color_key=>color) fill = Fill.new(pattern) - options[:type] == :dxf ? fill : fills << fill + dxf ? fill : fills << fill end # parses Style#add_style options for borders. |
