Skip to content

Instantly share code, notes, and snippets.

@cfobel
Last active March 19, 2021 14:55
Show Gist options
  • Save cfobel/fd939073cf13a309d7a9 to your computer and use it in GitHub Desktop.
Save cfobel/fd939073cf13a309d7a9 to your computer and use it in GitHub Desktop.
color palette
colors = [('Lite', 'Grey', 140, 140, 140),
('Lite', 'Blue', 136, 189, 230),
('Lite', 'Orange', 251, 178, 88),
('Lite', 'Green', 144, 205, 151),
('Lite', 'Pink', 246, 170, 201),
('Lite', 'Brown', 191, 165, 84),
('Lite', 'Purple', 188, 153, 199),
('Lite', 'Yellow', 237, 221, 70),
('Lite', 'Red', 240, 126, 110),
('Med', 'Grey', 77, 77, 77),
('Med', 'Blue', 93, 165, 218),
('Med', 'Orange', 250, 164, 58),
('Med', 'Green', 96, 189, 104),
('Med', 'Pink', 241, 124, 176),
('Med', 'Brown', 178, 145, 47),
('Med', 'Purple', 178, 118, 178),
('Med', 'Yellow', 222, 207, 63),
('Med', 'Red', 241, 88, 84),
('Dark', 'Grey', 0, 0, 0),
('Dark', 'Blue', 38, 93, 171),
('Dark', 'Orange', 223, 92, 36),
('Dark', 'Green', 5, 151, 72),
('Dark', 'Pink', 229, 18, 111),
('Dark', 'Brown', 157, 114, 42),
('Dark', 'Purple', 123, 58, 150),
('Dark', 'Yellow', 199, 180, 46),
('Dark', 'Red', 203, 32, 39)]
df_colors = pd.DataFrame(colors, columns=['intensity', 'name', 'r', 'g', 'b'])
df_colors['hex'] = (df_colors[['r', 'g', 'b']]
.apply(lambda rgb: 3 * '%02x' % tuple(rgb), axis=1))
# r g b hex
# intensity name
# Lite Grey 140 140 140 8c8c8c
# Blue 136 189 230 88bde6
# Orange 251 178 88 fbb258
# Green 144 205 151 90cd97
# Pink 246 170 201 f6aac9
# Brown 191 165 84 bfa554
# Purple 188 153 199 bc99c7
# Yellow 237 221 70 eddd46
# Red 240 126 110 f07e6e
# Med Grey 77 77 77 4d4d4d
# Blue 93 165 218 5da5da
# Orange 250 164 58 faa43a
# Green 96 189 104 60bd68
# Pink 241 124 176 f17cb0
# Brown 178 145 47 b2912f
# Purple 178 118 178 b276b2
# Yellow 222 207 63 decf3f
# Red 241 88 84 f15854
# Dark Grey 0 0 0 000000
# Blue 38 93 171 265dab
# Orange 223 92 36 df5c24
# Green 5 151 72 059748
# Pink 229 18 111 e5126f
# Brown 157 114 42 9d722a
# Purple 123 58 150 7b3a96
# Yellow 199 180 46 c7b42e
# Red 203 32 39 cb2027
Copyright (c) 2021 Christian Fobel
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment