Line data Source code
1 : ! ***********************************************************************
2 : !
3 : ! Copyright (C) 2010-2025 The MESA Team
4 : !
5 : ! This program is free software: you can redistribute it and/or modify
6 : ! it under the terms of the GNU Lesser General Public License
7 : ! as published by the Free Software Foundation,
8 : ! either version 3 of the License, or (at your option) any later version.
9 : !
10 : ! This program is distributed in the hope that it will be useful,
11 : ! but WITHOUT ANY WARRANTY; without even the implied warranty of
12 : ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 : ! See the GNU Lesser General Public License for more details.
14 : !
15 : ! You should have received a copy of the GNU Lesser General Public License
16 : ! along with this program. If not, see <https://www.gnu.org/licenses/>.
17 : !
18 : ! ***********************************************************************
19 :
20 : module pgstar_colors
21 : implicit none
22 : public
23 :
24 : integer, parameter :: clr_Background = 0
25 : integer, parameter :: clr_Foreground = 1
26 : ! Values are set for backwards compat
27 : integer, private, parameter :: clr_RedAlt = 2
28 : integer, private, parameter :: clr_GreenAlt = 3
29 : integer, private, parameter :: clr_BlueAlt = 4
30 : integer, parameter :: clr_Cyan = 5
31 : integer, parameter :: clr_Magenta = 6
32 : integer, parameter :: clr_Yellow = 7
33 : integer, parameter :: clr_Orange = 8
34 : integer, parameter :: clr_LimeGreen = 9
35 : integer, parameter :: clr_GreenYellow = 10
36 : integer, parameter :: clr_DodgerBlue = 11
37 : integer, parameter :: clr_MagentaDark = 12
38 : integer, parameter :: clr_Plum = 13
39 : integer, parameter :: clr_SandyBrown = 14
40 : integer, parameter :: clr_Salmon = 15
41 : integer, parameter :: clr_Grey59 = 16
42 : integer, parameter :: clr_Grey30 = 17
43 : integer, parameter :: clr_Black = 18
44 : integer, parameter :: clr_Blue = 19
45 : integer, parameter :: clr_BrightBlue = 20
46 : integer, parameter :: clr_Goldenrod = 21
47 : integer, parameter :: clr_Lilac = 22
48 : integer, parameter :: clr_Coral = 23
49 : integer, parameter :: clr_FireBrick = 24
50 : integer, parameter :: clr_RoyalPurple = 25
51 : integer, parameter :: clr_Gold = 26
52 : integer, parameter :: clr_Crimson = 27
53 : integer, parameter :: clr_SlateGray = 28
54 : integer, parameter :: clr_Teal = 29
55 : integer, parameter :: clr_LightSteelBlue = 30
56 : integer, parameter :: clr_MediumSlateBlue = 31
57 : integer, parameter :: clr_MediumSpringGreen = 32
58 : integer, parameter :: clr_MediumBlue = 33
59 : integer, parameter :: clr_RoyalBlue = 34
60 : integer, parameter :: clr_LightGray = 35
61 : integer, parameter :: clr_Silver = 36
62 : integer, parameter :: clr_DarkGray = 37
63 : integer, parameter :: clr_Gray = 38
64 : integer, parameter :: clr_LightSkyBlue = 39
65 : integer, parameter :: clr_LightSkyGreen = 40
66 : integer, parameter :: clr_SeaGreen = 41
67 : integer, parameter :: clr_Tan = 42
68 : integer, parameter :: clr_IndianRed = 43
69 : integer, parameter :: clr_LightOliveGreen = 44
70 : integer, parameter :: clr_CadetBlue = 45
71 : integer, parameter :: clr_Beige = 46
72 :
73 : integer, parameter :: colormap_offset = 46
74 : integer, parameter :: colormap_length = 101
75 :
76 : integer, parameter :: clr_no_mixing = clr_SeaGreen
77 : integer, parameter :: clr_convection = clr_LightSkyBlue
78 : integer, parameter :: clr_leftover_convection = clr_BrightBlue
79 : integer, parameter :: clr_semiconvection = clr_SlateGray
80 : integer, parameter :: clr_thermohaline = clr_Lilac
81 : integer, parameter :: clr_overshoot = clr_Beige
82 : integer, parameter :: clr_rotation = clr_LightSkyGreen
83 : integer, parameter :: clr_rayleigh_taylor = clr_IndianRed
84 : integer, parameter :: clr_minimum = clr_Coral
85 : integer, parameter :: clr_anonymous = clr_Tan
86 : contains
87 0 : subroutine set_device_colors(white_on_black_flag)
88 : logical, intent(in) :: white_on_black_flag
89 : integer :: i
90 0 : real, dimension(3, colormap_length) :: colormap
91 :
92 0 : if (white_on_black_flag) then
93 0 : call pgscr(clr_Background, 0., 0., 0.)
94 0 : call pgscr(clr_Foreground, 1., 1., 1.)
95 : else
96 0 : call pgscr(clr_Foreground, 0., 0., 0.)
97 0 : call pgscr(clr_Background, 1., 1., 1.)
98 : end if
99 : ! These are duplicated later, but we keep them for backwards compatibility
100 0 : call pgscr(clr_RedAlt, 1., 0., 0.)
101 0 : call pgscr(clr_GreenAlt, 0., 1., 0.)
102 0 : call pgscr(clr_BlueAlt, 0., 0., 1.)
103 :
104 0 : call pgscr(clr_Cyan, 0., 1., 1.)
105 0 : call pgscr(clr_Magenta, 1., 0., 1.)
106 0 : call pgscr(clr_Yellow, 1., 1., 0.)
107 0 : call pgscr(clr_Orange, 1., 0.65, 0.)
108 0 : call pgscr(clr_LimeGreen, 0.2, 0.8, 0.2)
109 0 : call pgscr(clr_GreenYellow, 0.68, 1., 0.18)
110 0 : call pgscr(clr_DodgerBlue, 0.12, 0.56, 1.0)
111 0 : call pgscr(clr_MagentaDark, 0.55, 0., 0.55)
112 0 : call pgscr(clr_Plum, 0.87, 0.63, 0.87)
113 0 : call pgscr(clr_SandyBrown, 0.96, 0.64, 0.38)
114 0 : call pgscr(clr_Salmon, 0.91, 0.59, 0.48)
115 0 : call pgscr(clr_Grey59, 0.59, 0.59, 0.59)
116 0 : call pgscr(clr_Grey30, 0.3, 0.3, 0.3)
117 :
118 : ! Tioga colors
119 0 : call pgscr(clr_Black, 0.0, 0.0, 0.0)
120 0 : call pgscr(clr_Blue, 0.0, 0.0, 1.0)
121 0 : call pgscr(clr_BrightBlue, 0.0, 0.4, 1.0)
122 0 : call pgscr(clr_LightSkyBlue, 0.53, 0.808, 0.98)
123 0 : call pgscr(clr_LightSkyGreen, 0.125, 0.698, 0.668)
124 0 : call pgscr(clr_MediumSpringGreen, 0.0, 0.98, 0.604)
125 0 : call pgscr(clr_Goldenrod, 0.855, 0.648, 0.125)
126 0 : call pgscr(clr_Lilac, 0.8, 0.6, 1.0)
127 0 : call pgscr(clr_Coral, 1.0, 0.498, 0.312)
128 0 : call pgscr(clr_FireBrick, 0.698, 0.132, 0.132)
129 0 : call pgscr(clr_RoyalPurple, 0.4, 0.0, 0.6)
130 0 : call pgscr(clr_Gold, 1.0, 0.844, 0.0)
131 0 : call pgscr(clr_Crimson, 0.8, 0.0, 0.2)
132 0 : call pgscr(clr_SlateGray, 0.44, 0.5, 0.565)
133 0 : call pgscr(clr_SeaGreen, 0.18, 0.545, 0.34)
134 0 : call pgscr(clr_Teal, 0.0, 0.5, 0.5)
135 0 : call pgscr(clr_LightSteelBlue, 0.69, 0.77, 0.87)
136 0 : call pgscr(clr_MediumSlateBlue, 0.484, 0.408, 0.932)
137 0 : call pgscr(clr_MediumBlue, 0.0, 0.0, 0.804)
138 0 : call pgscr(clr_RoyalBlue, 0.255, 0.41, 0.884)
139 0 : call pgscr(clr_LightGray, 0.828, 0.828, 0.828)
140 0 : call pgscr(clr_Silver, 0.752, 0.752, 0.752)
141 0 : call pgscr(clr_DarkGray, 0.664, 0.664, 0.664)
142 0 : call pgscr(clr_Gray, 0.5, 0.5, 0.5)
143 0 : call pgscr(clr_IndianRed, 0.804, 0.36, 0.36)
144 0 : call pgscr(clr_Tan, 0.824, 0.705, 0.55)
145 0 : call pgscr(clr_LightOliveGreen, 0.6, 0.8, 0.6)
146 0 : call pgscr(clr_CadetBlue, 0.372, 0.62, 0.628)
147 0 : call pgscr(clr_Beige, 0.96, 0.96, 0.864)
148 :
149 0 : colormap(1:3, 1) = [ 0.0, 0.0, 1.0 ]
150 0 : colormap(1:3, 2) = [ 0.0196078431372549, 0.0196078431372549, 1.0 ]
151 0 : colormap(1:3, 3) = [ 0.0352941176470588, 0.0352941176470588, 1.0 ]
152 0 : colormap(1:3, 4) = [ 0.0588235294117647, 0.0588235294117647, 1.0 ]
153 0 : colormap(1:3, 5) = [ 0.0705882352941176, 0.0705882352941176, 1.0 ]
154 0 : colormap(1:3, 6) = [ 0.0941176470588235, 0.0941176470588235, 1.0 ]
155 0 : colormap(1:3, 7) = [ 0.105882352941176, 0.105882352941176, 1.0 ]
156 0 : colormap(1:3, 8) = [ 0.129411764705882, 0.129411764705882, 1.0 ]
157 0 : colormap(1:3, 9) = [ 0.141176470588235, 0.141176470588235, 1.0 ]
158 0 : colormap(1:3, 10) = [ 0.164705882352941, 0.164705882352941, 1.0 ]
159 0 : colormap(1:3, 11) = [ 0.184313725490196, 0.184313725490196, 1.0 ]
160 0 : colormap(1:3, 12) = [ 0.2, 0.2, 1.0 ]
161 0 : colormap(1:3, 13) = [ 0.219607843137255, 0.219607843137255, 1.0 ]
162 0 : colormap(1:3, 14) = [ 0.235294117647059, 0.235294117647059, 1.0 ]
163 0 : colormap(1:3, 15) = [ 0.254901960784314, 0.254901960784314, 1.0 ]
164 0 : colormap(1:3, 16) = [ 0.270588235294118, 0.270588235294118, 1.0 ]
165 0 : colormap(1:3, 17) = [ 0.294117647058824, 0.294117647058824, 1.0 ]
166 0 : colormap(1:3, 18) = [ 0.305882352941176, 0.305882352941176, 1.0 ]
167 0 : colormap(1:3, 19) = [ 0.329411764705882, 0.329411764705882, 1.0 ]
168 0 : colormap(1:3, 20) = [ 0.341176470588235, 0.341176470588235, 1.0 ]
169 0 : colormap(1:3, 21) = [ 0.364705882352941, 0.364705882352941, 1.0 ]
170 0 : colormap(1:3, 22) = [ 0.384313725490196, 0.384313725490196, 1.0 ]
171 0 : colormap(1:3, 23) = [ 0.4, 0.4, 1.0 ]
172 0 : colormap(1:3, 24) = [ 0.419607843137255, 0.419607843137255, 1.0 ]
173 0 : colormap(1:3, 25) = [ 0.435294117647059, 0.435294117647059, 1.0 ]
174 0 : colormap(1:3, 26) = [ 0.454901960784314, 0.454901960784314, 1.0 ]
175 0 : colormap(1:3, 27) = [ 0.470588235294118, 0.470588235294118, 1.0 ]
176 0 : colormap(1:3, 28) = [ 0.490196078431373, 0.490196078431373, 1.0 ]
177 0 : colormap(1:3, 29) = [ 0.505882352941176, 0.505882352941176, 1.0 ]
178 0 : colormap(1:3, 30) = [ 0.529411764705882, 0.529411764705882, 1.0 ]
179 0 : colormap(1:3, 31) = [ 0.549019607843137, 0.549019607843137, 1.0 ]
180 0 : colormap(1:3, 32) = [ 0.564705882352941, 0.564705882352941, 1.0 ]
181 0 : colormap(1:3, 33) = [ 0.584313725490196, 0.584313725490196, 1.0 ]
182 0 : colormap(1:3, 34) = [ 0.6, 0.6, 1.0 ]
183 0 : colormap(1:3, 35) = [ 0.619607843137255, 0.619607843137255, 1.0 ]
184 0 : colormap(1:3, 36) = [ 0.635294117647059, 0.635294117647059, 1.0 ]
185 0 : colormap(1:3, 37) = [ 0.654901960784314, 0.654901960784314, 1.0 ]
186 0 : colormap(1:3, 38) = [ 0.670588235294118, 0.670588235294118, 1.0 ]
187 0 : colormap(1:3, 39) = [ 0.690196078431373, 0.690196078431373, 1.0 ]
188 0 : colormap(1:3, 40) = [ 0.705882352941177, 0.705882352941177, 1.0 ]
189 0 : colormap(1:3, 41) = [ 0.725490196078431, 0.725490196078431, 1.0 ]
190 0 : colormap(1:3, 42) = [ 0.749019607843137, 0.749019607843137, 1.0 ]
191 0 : colormap(1:3, 43) = [ 0.764705882352941, 0.764705882352941, 1.0 ]
192 0 : colormap(1:3, 44) = [ 0.784313725490196, 0.784313725490196, 1.0 ]
193 0 : colormap(1:3, 45) = [ 0.8, 0.8, 1.0 ]
194 0 : colormap(1:3, 46) = [ 0.831372549019608, 0.831372549019608, 1.0 ]
195 0 : colormap(1:3, 47) = [ 0.854901960784314, 0.854901960784314, 1.0 ]
196 0 : colormap(1:3, 48) = [ 0.890196078431372, 0.890196078431372, 1.0 ]
197 0 : colormap(1:3, 49) = [ 0.913725490196078, 0.913725490196078, 1.0 ]
198 0 : colormap(1:3, 50) = [ 0.949019607843137, 0.949019607843137, 1.0 ]
199 0 : colormap(1:3, 51) = [ 1.0, 0.972549019607843, 0.972549019607843 ]
200 0 : colormap(1:3, 52) = [ 1.0, 0.949019607843137, 0.949019607843137 ]
201 0 : colormap(1:3, 53) = [ 1.0, 0.913725490196078, 0.913725490196078 ]
202 0 : colormap(1:3, 54) = [ 1.0, 0.890196078431372, 0.890196078431372 ]
203 0 : colormap(1:3, 55) = [ 1.0, 0.854901960784314, 0.854901960784314 ]
204 0 : colormap(1:3, 56) = [ 1.0, 0.831372549019608, 0.831372549019608 ]
205 0 : colormap(1:3, 57) = [ 1.0, 0.8, 0.8 ]
206 0 : colormap(1:3, 58) = [ 1.0, 0.784313725490196, 0.784313725490196 ]
207 0 : colormap(1:3, 59) = [ 1.0, 0.764705882352941, 0.764705882352941 ]
208 0 : colormap(1:3, 60) = [ 1.0, 0.749019607843137, 0.749019607843137 ]
209 0 : colormap(1:3, 61) = [ 1.0, 0.725490196078431, 0.725490196078431 ]
210 0 : colormap(1:3, 62) = [ 1.0, 0.705882352941177, 0.705882352941177 ]
211 0 : colormap(1:3, 63) = [ 1.0, 0.690196078431373, 0.690196078431373 ]
212 0 : colormap(1:3, 64) = [ 1.0, 0.670588235294118, 0.670588235294118 ]
213 0 : colormap(1:3, 65) = [ 1.0, 0.654901960784314, 0.654901960784314 ]
214 0 : colormap(1:3, 66) = [ 1.0, 0.635294117647059, 0.635294117647059 ]
215 0 : colormap(1:3, 67) = [ 1.0, 0.619607843137255, 0.619607843137255 ]
216 0 : colormap(1:3, 68) = [ 1.0, 0.6, 0.6 ]
217 0 : colormap(1:3, 69) = [ 1.0, 0.584313725490196, 0.584313725490196 ]
218 0 : colormap(1:3, 70) = [ 1.0, 0.564705882352941, 0.564705882352941 ]
219 0 : colormap(1:3, 71) = [ 1.0, 0.541176470588235, 0.541176470588235 ]
220 0 : colormap(1:3, 72) = [ 1.0, 0.529411764705882, 0.529411764705882 ]
221 0 : colormap(1:3, 73) = [ 1.0, 0.505882352941176, 0.505882352941176 ]
222 0 : colormap(1:3, 74) = [ 1.0, 0.490196078431373, 0.490196078431373 ]
223 0 : colormap(1:3, 75) = [ 1.0, 0.470588235294118, 0.470588235294118 ]
224 0 : colormap(1:3, 76) = [ 1.0, 0.454901960784314, 0.454901960784314 ]
225 0 : colormap(1:3, 77) = [ 1.0, 0.435294117647059, 0.435294117647059 ]
226 0 : colormap(1:3, 78) = [ 1.0, 0.419607843137255, 0.419607843137255 ]
227 0 : colormap(1:3, 79) = [ 1.0, 0.4, 0.4 ]
228 0 : colormap(1:3, 80) = [ 1.0, 0.384313725490196, 0.384313725490196 ]
229 0 : colormap(1:3, 81) = [ 1.0, 0.364705882352941, 0.364705882352941 ]
230 0 : colormap(1:3, 82) = [ 1.0, 0.341176470588235, 0.341176470588235 ]
231 0 : colormap(1:3, 83) = [ 1.0, 0.329411764705882, 0.329411764705882 ]
232 0 : colormap(1:3, 84) = [ 1.0, 0.305882352941176, 0.305882352941176 ]
233 0 : colormap(1:3, 85) = [ 1.0, 0.294117647058824, 0.294117647058824 ]
234 0 : colormap(1:3, 86) = [ 1.0, 0.270588235294118, 0.270588235294118 ]
235 0 : colormap(1:3, 87) = [ 1.0, 0.254901960784314, 0.254901960784314 ]
236 0 : colormap(1:3, 88) = [ 1.0, 0.235294117647059, 0.235294117647059 ]
237 0 : colormap(1:3, 89) = [ 1.0, 0.219607843137255, 0.219607843137255 ]
238 0 : colormap(1:3, 90) = [ 1.0, 0.2, 0.2 ]
239 0 : colormap(1:3, 91) = [ 1.0, 0.176470588235294, 0.176470588235294 ]
240 0 : colormap(1:3, 92) = [ 1.0, 0.164705882352941, 0.164705882352941 ]
241 0 : colormap(1:3, 93) = [ 1.0, 0.141176470588235, 0.141176470588235 ]
242 0 : colormap(1:3, 94) = [ 1.0, 0.129411764705882, 0.129411764705882 ]
243 0 : colormap(1:3, 95) = [ 1.0, 0.105882352941176, 0.105882352941176 ]
244 0 : colormap(1:3, 96) = [ 1.0, 0.0941176470588235, 0.0941176470588235 ]
245 0 : colormap(1:3, 97) = [ 1.0, 0.0705882352941176, 0.0705882352941176 ]
246 0 : colormap(1:3, 98) = [ 1.0, 0.0588235294117647, 0.0588235294117647 ]
247 0 : colormap(1:3, 99) = [ 1.0, 0.0352941176470588, 0.0352941176470588 ]
248 0 : colormap(1:3, 100) = [ 1.0, 0.0196078431372549, 0.0196078431372549 ]
249 0 : colormap(1:3, 101) = [ 1.0, 0.0, 0.0 ]
250 :
251 0 : do i = 1, colormap_length
252 0 : call pgscr(colormap_offset + i, colormap(1, i), colormap(2, i), colormap(3, i))
253 : end do
254 0 : end subroutine set_device_colors
255 : end module pgstar_colors
256 :
|