-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding hex2rgb and rgb2hex function. Adding dvips colors (#14)
* Adding hex2rgb and rgb2hex function. * Adding dvips colors. * Switching off oldest gcc in CI.
- Loading branch information
Showing
10 changed files
with
1,119 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import cppcolormap as cm | ||
import numpy as np | ||
|
||
names = ( | ||
"Apricot", | ||
"Aquamarine", | ||
"Bittersweet", | ||
"Black", | ||
"Blue", | ||
"BlueGreen", | ||
"BlueViolet", | ||
"BrickRed", | ||
"Brown", | ||
"BurntOrange", | ||
"CadetBlue", | ||
"CarnationPink", | ||
"Cerulean", | ||
"CornflowerBlue", | ||
"Cyan", | ||
"Dandelion", | ||
"DarkOrchid", | ||
"Emerald", | ||
"ForestGreen", | ||
"Fuchsia", | ||
"Goldenrod", | ||
"Gray", | ||
"Green", | ||
"GreenYellow", | ||
"JungleGreen", | ||
"Lavender", | ||
"LimeGreen", | ||
"Magenta", | ||
"Mahogany", | ||
"Maroon", | ||
"Melon", | ||
"MidnightBlue", | ||
"Mulberry", | ||
"NavyBlue", | ||
"OliveGreen", | ||
"Orange", | ||
"OrangeRed", | ||
"Orchid", | ||
"Peach", | ||
"Periwinkle", | ||
"PineGreen", | ||
"Plum", | ||
"ProcessBlue", | ||
"Purple", | ||
"RawSienna", | ||
"Red", | ||
"RedOrange", | ||
"RedViolet", | ||
"Rhodamine", | ||
"RoyalBlue", | ||
"RoyalPurple", | ||
"RubineRed", | ||
"Salmon", | ||
"SeaGreen", | ||
"Sepia", | ||
"SkyBlue", | ||
"SpringGreen", | ||
"Tan", | ||
"TealBlue", | ||
"Thistle", | ||
"Turquoise", | ||
"Violet", | ||
"VioletRed", | ||
"WildStrawberry", | ||
"Yellow", | ||
"YellowGreen", | ||
"YellowOrange") | ||
|
||
dvips = np.array([list(cm.colormap(name, 1)[0, :]) for name in names]) | ||
jet = cm.jet(256) | ||
|
||
|
||
idx = cm.match(dvips, jet, cm.metric.perceptual) | ||
jdx = np.argsort(idx) | ||
print('\n'.join([names[i] for i in jdx])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.