-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpythonColors.m
More file actions
84 lines (72 loc) · 5.69 KB
/
pythonColors.m
File metadata and controls
84 lines (72 loc) · 5.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
(* ::Package:: *)
BeginPackage["pythonColors`"];
cMapFuncerRGB::usage="cMapFuncerRGB[cMapDataRGB]: provided a list of lists with RGB values this function will return a
ColorFunction object";
pyMagmaData::usage="pyMagmaData: is a list of RGB values for pythons Magma color scheme";
pyViridisData::usage="pyViridisData: is a list of RGB values for pythons Viridis color scheme";
pyMagma::usage="pyMagma: pythons Magma color scheme";
pyViridis::usage="pyViridis: pythons Magma color scheme";
pyBluesData::usage=""
pyGreensData::usage=""
pyRedsData::usage=""
pyOrangesData::usage=""
pyPurplesData::usage=""
pyBlues::usage="Blue color tone from python";
pyGreens::usage="Green color tone from python";
pyReds::usage="Red color tone from python";
pyOranges::usage="Orange color tone from python";
pyPurples::usage="Purple color tone from python";
Begin["`Private`"];
cMapFuncerRGB[cMapData_] := Blend[RGBColor @@@ cMapData, #1] &;
pyMagma = cMapFuncerRGB[pyMagmaData];
pyViridis = cMapFuncerRGB[pyViridisData];
pyBlues = cMapFuncerRGB[pyBluesData];
pyGreens = cMapFuncerRGB[pyGreensData];
pyReds = cMapFuncerRGB[pyRedsData];
pyOranges = cMapFuncerRGB[pyOrangesData];
pyPurples = cMapFuncerRGB[pyPurplesData];
pyMagmaData = (N@{
{0, 0, 4}, {7, 6, 28}, {22, 15, 59}, {41, 17, 90}, {64, 15, 116},
{86, 20, 125}, {107, 29, 129}, {128, 37, 130}, {148, 44, 128},
{171, 51, 124}, {192, 58, 118}, {214, 69, 108}, {232, 83, 98},
{244, 103, 92}, {250, 129, 95}, {253, 154, 106}, {254, 180, 123},
{254, 204, 143}, {253, 229, 167}, {252, 253, 191}
})/255;
pyViridisData = {
{0.266666666666666663, 0.00392156862745098034, 0.329411764705882348},
{0.282352941176470584, 0.0784313725490196068, 0.403921568627450989},
{0.282352941176470584, 0.149019607843137253, 0.4666666666666666741},
{0.270588235294117629, 0.215686274509803933, 0.505882352941176450},
{0.2470588235294117752, 0.278431372549019618, 0.5333333333333333259},
{0.223529411764705893, 0.333333333333333315, 0.549019607843137303},
{0.196078431372549017, 0.392156862745098034, 0.556862745098039236},
{0.176470588235294129, 0.443137254901960764, 0.556862745098039236},
{0.156862745098039214, 0.490196078431372528, 0.556862745098039236},
{0.1372549019607843257, 0.541176470588235259, 0.552941176470588269},
{0.1215686274509803905, 0.588235294117647078, 0.5450980392156862253},
{0.125490196078431371, 0.639215686274509753, 0.525490196078431393},
{0.160784313725490208, 0.686274509803921573, 0.498039215686274517},
{0.231372549019607854, 0.733333333333333282, 0.458823529411764686},
{0.3372549019607843368, 0.776470588235294135, 0.403921568627450989},
{0.4509803921568627527, 0.8156862745098039102, 0.3372549019607843368},
{0.584313725490196112, 0.847058823529411753, 0.250980392156862742},
{0.721568627450980382, 0.8705882352941176627, 0.160784313725490208},
{0.8666666666666666963, 0.890196078431372495, 0.0941176470588235281},
{0.992156862745098067, 0.9058823529411764719, 0.145098039215686286}
};
pyBluesData={
{0.9686274509803922`,0.984313725490196`,1.`},
{0.8705882352941177`,0.9215686274509803`,0.9686274509803922`},
{0.7764705882352941`,0.8588235294117647`,0.9372549019607843`},
{0.6196078431372549`,0.792156862745098`,0.8823529411764706`},
{0.4196078431372549`,0.6823529411764706`,0.8392156862745098`},
{0.2588235294117647`,0.5725490196078431`,0.7764705882352941`},
{0.12941176470588234`,0.44313725490196076`,0.7098039215686275`},
{0.03137254901960784`,0.3176470588235294`,0.611764705882353`},
{0.03137254901960784`,0.18823529411764706`,0.4196078431372549`}};
pyGreensData={{0.9686274509803922`,0.9882352941176471`,0.9607843137254902`},{0.8980392156862745`,0.9607843137254902`,0.8784313725490196`},{0.7803921568627451`,0.9137254901960784`,0.7529411764705882`},{0.6313725490196078`,0.8509803921568627`,0.6078431372549019`},{0.4549019607843137`,0.7686274509803921`,0.4627450980392157`},{0.2549019607843137`,0.6705882352941176`,0.36470588235294116`},{0.13725490196078433`,0.5450980392156862`,0.27058823529411763`},{0.`,0.42745098039215684`,0.17254901960784313`},{0.`,0.26666666666666666`,0.10588235294117647`}};
pyRedsData={{1.`,0.9607843137254902`,0.9411764705882353`},{0.996078431372549`,0.8784313725490196`,0.8235294117647058`},{0.9882352941176471`,0.7333333333333333`,0.6313725490196078`},{0.9882352941176471`,0.5725490196078431`,0.44705882352941173`},{0.984313725490196`,0.4156862745098039`,0.2901960784313725`},{0.9372549019607843`,0.23137254901960785`,0.17254901960784313`},{0.796078431372549`,0.09411764705882353`,0.11372549019607843`},{0.6470588235294118`,0.058823529411764705`,0.08235294117647059`},{0.403921568627451`,0.`,0.050980392156862744`}};
pyOrangesData={{1.`,0.9607843137254902`,0.9215686274509803`},{0.996078431372549`,0.9019607843137255`,0.807843137254902`},{0.9921568627450981`,0.8156862745098039`,0.6352941176470588`},{0.9921568627450981`,0.6823529411764706`,0.4196078431372549`},{0.9921568627450981`,0.5529411764705883`,0.23529411764705882`},{0.9450980392156862`,0.4117647058823529`,0.07450980392156863`},{0.8509803921568627`,0.2823529411764706`,0.00392156862745098`},{0.6509803921568628`,0.21176470588235294`,0.011764705882352941`},{0.4980392156862745`,0.15294117647058825`,0.01568627450980392`}};
pyPurplesData={{0.9882352941176471`,0.984313725490196`,0.9921568627450981`},{0.9372549019607843`,0.9294117647058824`,0.9607843137254902`},{0.8549019607843137`,0.8549019607843137`,0.9215686274509803`},{0.7372549019607844`,0.7411764705882353`,0.8627450980392157`},{0.6196078431372549`,0.6039215686274509`,0.7843137254901961`},{0.5019607843137255`,0.49019607843137253`,0.7294117647058823`},{0.4156862745098039`,0.3176470588235294`,0.6392156862745098`},{0.32941176470588235`,0.15294117647058825`,0.5607843137254902`},{0.24705882352941178`,0.`,0.49019607843137253`}};
End[]; (* `Private` *)
EndPackage[]