zdavatz / spreadsheet

The Ruby Spreadsheet by ywesee GmbH
http://spreadsheet.ch
GNU General Public License v3.0
1.13k stars 240 forks source link

Please consider providing a way to find out which colours are predefined. #145

Closed ghost closed 7 years ago

ghost commented 9 years ago

Hello.

I was trying to use :slateblue as colour.

For instance:

  format = Spreadsheet::Format.new :color => :slateblue,
                                   :weight => :bold,
                                   :size => 14

Spreadsheet told me this error:

spreadsheet-1.0.5/lib/spreadsheet/datatypes.rb:109:in `block (2 levels) in colors': unknown color 'slateblue' (ArgumentError)

Would it be possible to feedback a way of supported and available colours? (:slateblue I tried to use as it may be a "web colour"; the tutorial mentions :blue which is working, so I was trying to see whether I could use :slateblue as well).

E. g. colour inbuilts?

The syntax could be, to give an example:

Spreadsheet::Format.colours Spreadsheet::Format.colors

Or perhaps something such as:

Spreadsheet.available_colours?

If this is not a useful addition feel free to just close it.

Thanks for reading!

zdavatz commented 9 years ago

I am always happy to test a patch. Most important is, that all the tests will pass on Travis.

zdavatz commented 9 years ago

have you seen: https://github.com/zdavatz/spreadsheet/search?q=colors&type=Issues&utf8=%E2%9C%93

hqsiswiliam commented 8 years ago

Maybe you can try the color list on: http://www.softwaremaniacs.net/2013/11/setting-cell-color-using-ruby.html

zdavatz commented 8 years ago

Thank you for this input.