Skip to content

Instantly share code, notes, and snippets.

@henrygarner
Created March 11, 2010 12:38
Show Gist options
  • Save henrygarner/329097 to your computer and use it in GitHub Desktop.
Save henrygarner/329097 to your computer and use it in GitHub Desktop.
require 'spreadsheet'
# Code to add integer keys and Excel colorindex codes to
# ruby-spreadsheet's Font and Format api.
# eg. Spreadsheet::Format.new :color => 1
module Spreadsheet::Excel::Internals
(1..56).collect { |i| SEDOC_ROLOC[i.to_s.to_sym] = i + 7 }
end
class << Spreadsheet::Font
(1..56).each { |i| COLORS << i.to_s.to_sym }
end
class << Spreadsheet::Format
(1..56).each { |i| COLORS << i.to_s.to_sym }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment