diff options
| author | Randy Morgan (@morgan_randy) <[email protected]> | 2016-11-15 11:02:18 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-11-15 11:02:18 +0900 |
| commit | 27f1507035f460471620ef7b3fe0b448211f0096 (patch) | |
| tree | 61c02173d5f5853eba9a7e7617bba73d368b7b41 /lib | |
| parent | f525dfcf1ced51f235d1868310f5a65c8999d491 (diff) | |
| parent | 193227481e8439a65bb07d94a6121f9f1884150d (diff) | |
| download | caxlsx-27f1507035f460471620ef7b3fe0b448211f0096.tar.gz caxlsx-27f1507035f460471620ef7b3fe0b448211f0096.zip | |
Merge pull request #492 from sato-s/color
set color with Row#color=
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/row.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/axlsx/workbook/worksheet/row.rb b/lib/axlsx/workbook/worksheet/row.rb index 078e281f..b394279f 100644 --- a/lib/axlsx/workbook/worksheet/row.rb +++ b/lib/axlsx/workbook/worksheet/row.rb @@ -103,6 +103,13 @@ module Axlsx c end + # sets the color for every cell in this row + def color=(color) + each_with_index do | cell, index | + cell.color = color.is_a?(Array) ? color[index] : color + end + end + # sets the style for every cell in this row def style=(style) each_with_index do | cell, index | |
