Skip to content

Instantly share code, notes, and snippets.

View DominicWatson's full-sized avatar

Dominic Watson DominicWatson

View GitHub Profile
@DominicWatson
DominicWatson / gist:1211688
Created September 12, 2011 16:27
Some code to make color customization in ColdFusion 9's cfspreadsheet implementation clean
<cfscript>
void function spreadsheetSetCustomPalette(required any workbook, required struct palette){
var customPalette = arguments.workbook.getworkbook().getcustompalette();
var color = "";
var colorIndex = 0;
var rgb = "";
for(color in palette){
try{
colorIndex = CreateObject("java", "org.apache.poi.hssf.util.HSSFColor$#UCase( color )#").GetIndex();