 |
Forums |
Admin Discussion Forums: help Start New Thread
By: Brad Huber
RE: more colors [ reply ] 2011-01-24 17:57
|
I know this is quite a bit after the fact, but for the benefit of those, like me, who came after and found this via Google looking for an answer to the same question:
Here's what I did to add the two colors I needed, but this can be easily modified to add all available colors in Excel.
in /lib/spreadsheet/datatypes.rb, to the COLORS array, I added :light_green, :light_yellow
in /lib/spreadsheet/excel/internals.rb, to the COLOR_CODES hash, I added
0x002a => :light_green,
0x002b => :light_yellow
If you go here http://www.mvps.org/dmcritchie/excel/colors.htm you see that light_green and light_yellow are Color35 and Color36. To get lavender (color 39) you would add :lavender and 0x002e => :lavender to the gem.
Hope this helps anyone trying to add extra colors to this gem.
|
By: charles lesburg
more colors [ reply ] 2009-07-10 19:04
|
Hi all. I'd like to access the pastel-type colors that excel can use (e.g. Tan, Rose, Lavender, etc.) The Spreadsheet::Excel::Internals::COLOR_CODES doesn't contain these. Any advice for how to color cells using colors that don't exist in this hash?
-cal
|
|
 |