Skip to content

Instantly share code, notes, and snippets.

@e9t
Last active December 10, 2015 17:28
Show Gist options
  • Save e9t/4467881 to your computer and use it in GitHub Desktop.
Save e9t/4467881 to your computer and use it in GitHub Desktop.
Spotfire colors

Spotfire colors

  • Show HEX colors used in Spotfire
(function () {
var bgs= ['#000', '#003', '#EEE', '#FFF'];
var colors = ['#FD026C', '#4682B8', '#A5D22D', '#F5CC0A', '#FE8C01', '#6B9494', '#B97C46', '#84ACD0', '#C2E173', '#F9DD5B', '#FF53A7', '#FEBA55', '#9DB8BF', '#D5B084', '#396FAB', '#88B72D', '#D4AF19', '#DE005E', '#DD7502', '#5C7E7F', '#9F6F41', '#689ACB', '#BBDB56', '#FFDA2D', '#FF2D8A', '#FDA134', '#83ACAE', '#CC9765', '#2E6579'];
$.each(bgs, function() {
document.write("<div id=\"" + this + "\" style=\"background-color:" + this + "\">");
$.each(colors, function() {
document.write("<div id=\"" + this + "\" class=\"color\">");
document.write("<div class=\"color-box\" style=\"background-color:" + this + ";\">");
document.write('</div>');
document.write("<div class=\"description\" style=\"color:" + this + ";\">" + this + "</div>");
document.write("</div>");
});
document.write("</div>");
});
}());
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"
type="text/javascript"></script>
<script src="colors.js" type="text/javascript"></script>
<style type="text/css">
div {
display: inline-block;
}
.color {
display: inline-block;
margin: 10px;
}
.color-box {
width: 10px;
height: 10px;
margin: 0 5px;
}
.description {
width: 50px;
}
</style>
</head>
<body>
<script>
$('div')
</script>
</body>
</html>
#! /usr/bin/python2.7
# -*- coding: utf-8 -*-
def read_rgbs(filename):
with open(filename,'r') as f:
rgbs = f.read()
return rgbs
def rgb2hex(rgbs):
rgblist = rgbs.split('\n')
hexlist = [_rgb2hex(rgb) for rgb in rgblist]
return hexlist
def _rgb2hex(rgbstr):
rgblist = [int(rgb) for rgb in rgbstr.split(',')]
hexstr = '#' + ''.join(["%0.2X" % rgb for rgb in rgblist])
return hexstr
if __name__=='__main__':
filename = 'sfrgb.csv'
sfrgb = read_rgbs(filename)
sfhex = rgb2hex(sfrgb)
print sfhex
#FD026C
#4682B8
#A5D22D
#F5CC0A
#FE8C01
#6B9494
#B97C46
#84ACD0
#C2E173
#F9DD5B
#FF53A7
#FEBA55
#9DB8BF
#D5B084
#396FAB
#88B72D
#D4AF19
#DE005E
#DD7502
#5C7E7F
#9F6F41
#689ACB
#BBDB56
#FFDA2D
#FF2D8A
#FDA134
#83ACAE
#CC9765
#2E6579
253 2 108
70 130 184
165 210 45
245 204 10
254 140 1
107 148 148
185 124 70
132 172 208
194 225 115
249 221 91
255 83 167
254 186 85
157 184 191
213 176 132
57 111 171
136 183 45
212 175 25
222 0 94
221 117 2
92 126 127
159 111 65
104 154 203
187 219 86
255 218 45
255 45 138
253 161 52
131 172 174
204 151 101
46 101 121
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment