rgss 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +7 -0
  2. data/.clang-format +6 -0
  3. data/.gitignore +167 -0
  4. data/.yardopts +6 -0
  5. data/CHANGELOG.md +4 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +21 -0
  8. data/Rakefile +9 -0
  9. data/ext/rgss/cglm-v0.7.9.tar.gz +0 -0
  10. data/ext/rgss/color.c +599 -0
  11. data/ext/rgss/entity.c +373 -0
  12. data/ext/rgss/extconf.rb +53 -0
  13. data/ext/rgss/font.c +135 -0
  14. data/ext/rgss/game.c +469 -0
  15. data/ext/rgss/game.h +99 -0
  16. data/ext/rgss/gl.c +3217 -0
  17. data/ext/rgss/glad.c +1140 -0
  18. data/ext/rgss/glad.h +2129 -0
  19. data/ext/rgss/glfw.c +1453 -0
  20. data/ext/rgss/graphics.c +324 -0
  21. data/ext/rgss/image.c +274 -0
  22. data/ext/rgss/input.c +745 -0
  23. data/ext/rgss/khrplatform.h +290 -0
  24. data/ext/rgss/mat4.c +279 -0
  25. data/ext/rgss/pax_global_header +1 -0
  26. data/ext/rgss/point.c +253 -0
  27. data/ext/rgss/rect.c +449 -0
  28. data/ext/rgss/rgss.c +56 -0
  29. data/ext/rgss/rgss.h +241 -0
  30. data/ext/rgss/stb_image.h +7762 -0
  31. data/ext/rgss/stb_image_write.h +1690 -0
  32. data/ext/rgss/stb_rect_pack.h +628 -0
  33. data/ext/rgss/stb_truetype.h +5011 -0
  34. data/ext/rgss/utf8.h +1652 -0
  35. data/ext/rgss/uthash.h +1133 -0
  36. data/ext/rgss/vec.c +114 -0
  37. data/ext/rgss/vec.h +192 -0
  38. data/ext/rgss/vec2.c +489 -0
  39. data/ext/rgss/vec3.c +751 -0
  40. data/ext/rgss/vec4.c +681 -0
  41. data/lib/rgss.rb +140 -0
  42. data/lib/rgss/batch.rb +57 -0
  43. data/lib/rgss/blend.rb +47 -0
  44. data/lib/rgss/game_object.rb +28 -0
  45. data/lib/rgss/plane.rb +95 -0
  46. data/lib/rgss/renderable.rb +158 -0
  47. data/lib/rgss/rgss.so +0 -0
  48. data/lib/rgss/shader.rb +94 -0
  49. data/lib/rgss/shaders/sprite-frag.glsl +40 -0
  50. data/lib/rgss/shaders/sprite-vert.glsl +17 -0
  51. data/lib/rgss/sprite.rb +139 -0
  52. data/lib/rgss/stubs/color.rb +318 -0
  53. data/lib/rgss/stubs/gl.rb +1999 -0
  54. data/lib/rgss/stubs/glfw.rb +626 -0
  55. data/lib/rgss/stubs/rect.rb +324 -0
  56. data/lib/rgss/stubs/rpg.rb +267 -0
  57. data/lib/rgss/stubs/tone.rb +65 -0
  58. data/lib/rgss/texture.rb +132 -0
  59. data/lib/rgss/tilemap.rb +116 -0
  60. data/lib/rgss/version.rb +3 -0
  61. data/lib/rgss/viewport.rb +67 -0
  62. data/rgss.gemspec +44 -0
  63. data/test.png +0 -0
  64. metadata +178 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8e3207e25f858a93acd59e80628dc5caf254c1029d77ee29e37387d3f9f7761b
4
+ data.tar.gz: 272b46e4cd7446eae4abebdf7693f51b140f789fa44fa67fee2ea480d3ace02b
5
+ SHA512:
6
+ metadata.gz: 4608590ba15c8f8b01e763a8bdb87896d0f05e578efd30ba6573f1d44ce6ffe9639a003b803705a05b3a21105fec70d426c4460fcfbb3f4d86ce35d6c8456abd
7
+ data.tar.gz: 7fa4125c3fbb9520401eb693cead3abaee218dffcf62436c056aee045c84c9e65dd9db0453379fe1b56758dfdc4a14f8b2e88b5a4905a27aad5e5a54c0c89302
@@ -0,0 +1,6 @@
1
+ ---
2
+ BasedOnStyle: Microsoft
3
+ AlignConsecutiveMacros: true
4
+ AlignTrailingComments: true
5
+ IndentCaseLabels: true
6
+ ...
@@ -0,0 +1,167 @@
1
+
2
+ # Created by https://www.toptal.com/developers/gitignore/api/ruby,rubymine+all,visualstudiocode
3
+ # Edit at https://www.toptal.com/developers/gitignore?templates=ruby,rubymine+all,visualstudiocode
4
+
5
+ ### Ruby ###
6
+ *.gem
7
+ *.rbc
8
+ /.config
9
+ /coverage/
10
+ /InstalledFiles
11
+ /pkg/
12
+ /spec/reports/
13
+ /spec/examples.txt
14
+ /test/tmp/
15
+ /test/version_tmp/
16
+ /tmp/
17
+
18
+ # Used by dotenv library to load environment variables.
19
+ # .env
20
+
21
+ # Ignore Byebug command history file.
22
+ .byebug_history
23
+
24
+ ## Specific to RubyMotion:
25
+ .dat*
26
+ .repl_history
27
+ build/
28
+ *.bridgesupport
29
+ build-iPhoneOS/
30
+ build-iPhoneSimulator/
31
+
32
+ ## Specific to RubyMotion (use of CocoaPods):
33
+ #
34
+ # We recommend against adding the Pods directory to your .gitignore. However
35
+ # you should judge for yourself, the pros and cons are mentioned at:
36
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
37
+ # vendor/Pods/
38
+
39
+ ## Documentation cache and generated files:
40
+ /.yardoc/
41
+ /_yardoc/
42
+ /doc/
43
+ /rdoc/
44
+
45
+ ## Environment normalization:
46
+ /.bundle/
47
+ /vendor/bundle
48
+ /lib/bundler/man/
49
+
50
+ # for a library or gem, you might want to ignore these files since the code is
51
+ # intended to run in multiple environments; otherwise, check them in:
52
+ # Gemfile.lock
53
+ # .ruby-version
54
+ # .ruby-gemset
55
+
56
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
57
+ .rvmrc
58
+
59
+ # Used by RuboCop. Remote config files pulled in from inherit_from directive.
60
+ # .rubocop-https?--*
61
+
62
+ ### Ruby Patch ###
63
+ # Used by RuboCop. Remote config files pulled in from inherit_from directive.
64
+ # .rubocop-https?--*
65
+
66
+ ### RubyMine+all ###
67
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
68
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
69
+
70
+ # User-specific stuff
71
+ .idea/**/workspace.xml
72
+ .idea/**/tasks.xml
73
+ .idea/**/usage.statistics.xml
74
+ .idea/**/dictionaries
75
+ .idea/**/shelf
76
+
77
+ # Generated files
78
+ .idea/**/contentModel.xml
79
+
80
+ # Sensitive or high-churn files
81
+ .idea/**/dataSources/
82
+ .idea/**/dataSources.ids
83
+ .idea/**/dataSources.local.xml
84
+ .idea/**/sqlDataSources.xml
85
+ .idea/**/dynamic.xml
86
+ .idea/**/uiDesigner.xml
87
+ .idea/**/dbnavigator.xml
88
+
89
+ # Gradle
90
+ .idea/**/gradle.xml
91
+ .idea/**/libraries
92
+
93
+ # Gradle and Maven with auto-import
94
+ # When using Gradle or Maven with auto-import, you should exclude module files,
95
+ # since they will be recreated, and may cause churn. Uncomment if using
96
+ # auto-import.
97
+ # .idea/artifacts
98
+ # .idea/compiler.xml
99
+ # .idea/jarRepositories.xml
100
+ # .idea/modules.xml
101
+ # .idea/*.iml
102
+ # .idea/modules
103
+ # *.iml
104
+ # *.ipr
105
+
106
+ # CMake
107
+ cmake-build-*/
108
+
109
+ # Mongo Explorer plugin
110
+ .idea/**/mongoSettings.xml
111
+
112
+ # File-based project format
113
+ *.iws
114
+
115
+ # IntelliJ
116
+ out/
117
+
118
+ # mpeltonen/sbt-idea plugin
119
+ .idea_modules/
120
+
121
+ # JIRA plugin
122
+ atlassian-ide-plugin.xml
123
+
124
+ # Cursive Clojure plugin
125
+ .idea/replstate.xml
126
+
127
+ # Crashlytics plugin (for Android Studio and IntelliJ)
128
+ com_crashlytics_export_strings.xml
129
+ crashlytics.properties
130
+ crashlytics-build.properties
131
+ fabric.properties
132
+
133
+ # Editor-based Rest Client
134
+ .idea/httpRequests
135
+
136
+ # Android studio 3.1+ serialized cache file
137
+ .idea/caches/build_file_checksums.ser
138
+
139
+ ### RubyMine+all Patch ###
140
+ # Ignores the whole .idea folder and all .iml files
141
+ # See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
142
+
143
+ .idea/
144
+
145
+ # Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
146
+
147
+ *.iml
148
+ modules.xml
149
+ .idea/misc.xml
150
+ *.ipr
151
+
152
+ # Sonarlint plugin
153
+ .idea/sonarlint
154
+
155
+ ### VisualStudioCode ###
156
+ .vscode/*
157
+ !.vscode/tasks.json
158
+ !.vscode/launch.json
159
+ *.code-workspace
160
+
161
+ ### VisualStudioCode Patch ###
162
+ # Ignore all local history of files
163
+ .history
164
+ .ionide
165
+
166
+ # End of https://www.toptal.com/developers/gitignore/api/ruby,rubymine+all,visualstudiocode
167
+ /ext/rgss/cglm-0.7.9/
@@ -0,0 +1,6 @@
1
+ --readme README.md
2
+ --title 'RGSS Documentation'
3
+ --charset utf-8
4
+ --markup markdown
5
+ --protected
6
+ lib/**/*.rb
@@ -0,0 +1,4 @@
1
+ #Version History
2
+
3
+ ##Version 1.0
4
+ [*] Initial Release
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rgss.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Eric Freed
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,9 @@
1
+ require 'rake/extensiontask'
2
+
3
+ task build: :compile
4
+
5
+ Rake::ExtensionTask.new('rgss') do |ext|
6
+ ext.lib_dir = 'lib/rgss'
7
+ end
8
+
9
+ task default: %i[clobber compile]
@@ -0,0 +1,599 @@
1
+ #include "rgss.h"
2
+
3
+ VALUE rb_cColor;
4
+ VALUE rb_cTone;
5
+
6
+ RGSS_DEFINE_MARSHAL(RGSS_Color)
7
+
8
+ VALUE RGSS_Color_New(VALUE klass, float r, float g, float b, float a)
9
+ {
10
+ float *color = RGSS_VEC4_NEW;
11
+ color[0] = r;
12
+ color[1] = g;
13
+ color[2] = b;
14
+ color[3] = a;
15
+ glm_vec4_clamp(color, 0.0f, 1.0f);
16
+ return Data_Wrap_Struct(klass, NULL, free, color);
17
+ }
18
+
19
+ static VALUE RGSS_Color_Alloc(VALUE klass)
20
+ {
21
+ float *color = RGSS_VEC4_NEW;
22
+ glm_vec4_zero(color);
23
+ return Data_Wrap_Struct(klass, NULL, free, color);
24
+ }
25
+
26
+ static VALUE RGSS_Color_Initialize(int argc, VALUE *argv, VALUE self)
27
+ {
28
+ VALUE r, g, b, a;
29
+ rb_scan_args(argc, argv, "31", &r, &g, &b, &a);
30
+
31
+ float *color = DATA_PTR(self);
32
+ color[0] = NUM2FLT(r);
33
+ color[1] = NUM2FLT(g);
34
+ color[2] = NUM2FLT(b);
35
+ color[3] = RTEST(a) ? NUM2FLT(a) : 1.0f;
36
+
37
+ glm_vec4_clamp(color, 0.0f, 1.0f);
38
+ return self;
39
+ }
40
+
41
+ static VALUE RGSS_Tone_Initialize(int argc, VALUE *argv, VALUE self)
42
+ {
43
+ VALUE r, g, b, a;
44
+ rb_scan_args(argc, argv, "31", &r, &g, &b, &a);
45
+
46
+ float *tone = DATA_PTR(self);
47
+ tone[0] = NUM2FLT(r);
48
+ tone[1] = NUM2FLT(g);
49
+ tone[2] = NUM2FLT(b);
50
+ tone[3] = RTEST(a) ? glm_clamp(NUM2FLT(a), 0.0f, 1.0f) : 1.0f;
51
+
52
+ glm_vec3_clamp(tone, -1.0f, 1.0f);
53
+ return self;
54
+ }
55
+
56
+ static VALUE RGSS_Color_GetRed(VALUE self)
57
+ {
58
+ return DBL2NUM(((float *)DATA_PTR(self))[0]);
59
+ }
60
+
61
+ static VALUE RGSS_Color_GetGreen(VALUE self)
62
+ {
63
+ return DBL2NUM(((float *)DATA_PTR(self))[1]);
64
+ }
65
+
66
+ static VALUE RGSS_Color_GetBlue(VALUE self)
67
+ {
68
+ return DBL2NUM(((float *)DATA_PTR(self))[2]);
69
+ }
70
+
71
+ static VALUE RGSS_Color_GetAlpha(VALUE self)
72
+ {
73
+ return DBL2NUM(((float *)DATA_PTR(self))[3]);
74
+ }
75
+
76
+ static VALUE RGSS_Color_Equal(VALUE self, VALUE other)
77
+ {
78
+ if (CLASS_OF(self) != CLASS_OF(other))
79
+ return Qfalse;
80
+
81
+ float *v1 = DATA_PTR(self), *v2 = DATA_PTR(other);
82
+ return RB_BOOL(glm_vec4_eqv(v1, v2));
83
+ }
84
+
85
+ static VALUE RGSS_Color_Mix(VALUE klass, VALUE from, VALUE to, VALUE amount)
86
+ {
87
+ float *c1 = DATA_PTR(from), *c2 = DATA_PTR(to);
88
+ float t = glm_clamp(NUM2FLT(amount), 0.0f, 1.0f);
89
+
90
+ float *result = RGSS_VEC4_NEW;
91
+
92
+ glm_vec4_lerp(c1, c2, t, result);
93
+ return Data_Wrap_Struct(klass, NULL, free, result);
94
+ }
95
+
96
+ static VALUE RGSS_Color_Inspect(VALUE self)
97
+ {
98
+ float *c = DATA_PTR(self);
99
+ return rb_sprintf("<%.4f, %.4f, %.4f, %.4f>", c[0], c[1], c[2], c[3]);
100
+ }
101
+
102
+ static VALUE RGSS_Color_Clone(VALUE self)
103
+ {
104
+ float *c1 = DATA_PTR(self), *c2 = RGSS_VEC4_NEW;
105
+ glm_vec4_copy(c1, c2);
106
+ return Data_Wrap_Struct(CLASS_OF(self), NULL, free, c2);
107
+ }
108
+
109
+ static VALUE RGSS_Color_ToArray(VALUE self)
110
+ {
111
+ float *vec = DATA_PTR(self);
112
+ return rb_ary_new_from_args(4, DBL2NUM(vec[0]), DBL2NUM(vec[1]), DBL2NUM(vec[2]), DBL2NUM(vec[3]));
113
+ }
114
+
115
+ static VALUE RGSS_Color_ToHash(VALUE self)
116
+ {
117
+ float *vec = DATA_PTR(self);
118
+ VALUE hash = rb_hash_new();
119
+
120
+ rb_hash_aset(hash, STR2SYM("red"), DBL2NUM(vec[0]));
121
+ rb_hash_aset(hash, STR2SYM("green"), DBL2NUM(vec[1]));
122
+ rb_hash_aset(hash, STR2SYM("blue"), DBL2NUM(vec[2]));
123
+ rb_hash_aset(hash, STR2SYM("alpha"), DBL2NUM(vec[3]));
124
+
125
+ return hash;
126
+ }
127
+
128
+ static VALUE RGSS_Tone_ToHash(VALUE self)
129
+ {
130
+ float *vec = DATA_PTR(self);
131
+ VALUE hash = rb_hash_new();
132
+
133
+ rb_hash_aset(hash, STR2SYM("red"), DBL2NUM(vec[0]));
134
+ rb_hash_aset(hash, STR2SYM("green"), DBL2NUM(vec[1]));
135
+ rb_hash_aset(hash, STR2SYM("blue"), DBL2NUM(vec[2]));
136
+ rb_hash_aset(hash, STR2SYM("gray"), DBL2NUM(vec[3]));
137
+
138
+ return hash;
139
+ }
140
+
141
+ static VALUE RGSS_Color_GetHue(VALUE self)
142
+ {
143
+ float *color = DATA_PTR(self);
144
+
145
+ if (glm_eq(color[0], color[1]) && glm_eq(color[1], color[2]))
146
+ {
147
+ return DBL2NUM(0.0);
148
+ }
149
+
150
+ float max = glm_max(color[0], glm_max(color[1], color[2]));
151
+ float min = glm_min(color[0], glm_min(color[1], color[2]));
152
+ float delta = max - min, hue = 0.0;
153
+
154
+ if (glm_eq(color[0], max))
155
+ {
156
+ hue = (color[1] - color[2]) / delta;
157
+ }
158
+ else if (glm_eq(color[1], max))
159
+ {
160
+ hue = 2.0f + (color[2] - color[0]) / delta;
161
+ }
162
+ else if (glm_eq(color[2], max))
163
+ {
164
+ hue = 4.0f + (color[0] - color[1]) / delta;
165
+ }
166
+
167
+ hue *= 60.0f;
168
+ if (hue < 0.0f)
169
+ hue += 360.0f;
170
+
171
+ return DBL2NUM(hue);
172
+ }
173
+
174
+ static VALUE RGSS_Color_GetSaturation(VALUE self)
175
+ {
176
+ float *color = DATA_PTR(self);
177
+ float max = glm_max(color[0], glm_max(color[1], color[2]));
178
+ float min = glm_min(color[0], glm_min(color[1], color[2]));
179
+ float lightness, s = 0.0f;
180
+
181
+ if (fabsf(max - min) > __FLT_EPSILON__)
182
+ {
183
+ lightness = (max + min) * 0.5f;
184
+ s = (max - min) / (lightness <= 0.5f ? (max + min) : (2 - max - min));
185
+ }
186
+ return DBL2NUM(s);
187
+ }
188
+
189
+ static VALUE RGSS_Color_GetBrightness(VALUE self)
190
+ {
191
+ float *color = DATA_PTR(self);
192
+ return DBL2NUM(glm_max(color[0], glm_max(color[1], color[2])));
193
+ }
194
+
195
+ static VALUE RGSS_Color_GetLightness(VALUE self)
196
+ {
197
+ float *color = DATA_PTR(self);
198
+ float max = glm_max(color[0], glm_max(color[1], color[2]));
199
+ float min = glm_min(color[0], glm_min(color[1], color[2]));
200
+ return DBL2NUM((max + min) * 0.5f);
201
+ }
202
+
203
+ static VALUE RGSS_Color_GetHSL(VALUE self)
204
+ {
205
+ float *color = DATA_PTR(self);
206
+ float max = glm_max(color[0], glm_max(color[1], color[2]));
207
+ float min = glm_min(color[0], glm_min(color[1], color[2]));
208
+ float delta = max - min, lightness = (max + min) * 0.5f, hue = 0.0f, saturation = 0.0f;
209
+
210
+ if (delta > __FLT_EPSILON__)
211
+ {
212
+ saturation = (max - min) / (lightness <= 0.5f ? (max + min) : (2 - max - min));
213
+
214
+ if (glm_eq(color[0], max))
215
+ {
216
+ hue = (color[1] - color[2]) / delta;
217
+ }
218
+ else if (glm_eq(color[1], max))
219
+ {
220
+ hue = 2.0f + (color[2] - color[0]) / delta;
221
+ }
222
+ else if (glm_eq(color[2], max))
223
+ {
224
+ hue = 4.0f + (color[0] - color[1]) / delta;
225
+ }
226
+
227
+ hue *= 60.0f;
228
+ if (hue < 0.0f)
229
+ hue += 360.0f;
230
+ }
231
+ return rb_ary_new_from_args(3, DBL2NUM(hue), DBL2NUM(saturation), DBL2NUM(lightness));
232
+ }
233
+
234
+ static VALUE RGSS_Color_GetHSB(VALUE self)
235
+ {
236
+ float *color = DATA_PTR(self);
237
+ float max = glm_max(color[0], glm_max(color[1], color[2]));
238
+ float min = glm_min(color[0], glm_min(color[1], color[2]));
239
+ float delta = max - min, s = 0.0f, h = 0.0f, v = max;
240
+
241
+ if (delta > __FLT_EPSILON__)
242
+ {
243
+ s = (delta / max);
244
+ if (color[0] >= max)
245
+ h = (color[1] - color[2]) / delta;
246
+ else if (color[1] >= max)
247
+ h = 2.0f + (color[2] - color[0]) / delta;
248
+ else
249
+ h = 4.0f + (color[0] - color[1]) / delta;
250
+ h *= 60.0f;
251
+ if (h < 0.0f)
252
+ h += 360.0f;
253
+ }
254
+ return rb_ary_new_from_args(3, DBL2NUM(h), DBL2NUM(s), DBL2NUM(v));
255
+ }
256
+
257
+ static void RGSS_Color_HSB2RGB(float *color, float hue, float saturation, float brightness)
258
+ {
259
+ float r, g, b;
260
+
261
+ if (saturation < __FLT_EPSILON__)
262
+ {
263
+ r = brightness;
264
+ g = brightness;
265
+ b = brightness;
266
+ }
267
+ else
268
+ {
269
+ float p, q, t, ff;
270
+ if (hue >= 360.0f)
271
+ hue = 0.0f;
272
+ hue /= 60.0f;
273
+ int i = (int)hue;
274
+ ff = hue - i;
275
+ p = brightness * (1.0f - saturation);
276
+ q = brightness * (1.0f - (saturation * ff));
277
+ t = brightness * (1.0f - (saturation * (1.0f - ff)));
278
+
279
+ switch (i)
280
+ {
281
+ case 0:
282
+ r = brightness;
283
+ g = t;
284
+ b = p;
285
+ break;
286
+ case 1:
287
+ r = q;
288
+ g = brightness;
289
+ b = p;
290
+ break;
291
+ case 2:
292
+ r = p;
293
+ g = brightness;
294
+ b = t;
295
+ break;
296
+ case 3:
297
+ r = p;
298
+ g = q;
299
+ b = brightness;
300
+ break;
301
+ case 4:
302
+ r = t;
303
+ g = p;
304
+ b = brightness;
305
+ break;
306
+ case 5:
307
+ default:
308
+ r = brightness;
309
+ g = p;
310
+ b = q;
311
+ break;
312
+ }
313
+ }
314
+
315
+ color[0] = r;
316
+ color[1] = g;
317
+ color[2] = b;
318
+ }
319
+
320
+ static VALUE RGSS_Color_FromHSB(int argc, VALUE *argv, VALUE klass)
321
+ {
322
+ VALUE hue, saturation, brightness, alpha;
323
+ rb_scan_args(argc, argv, "31", &hue, &saturation, &brightness, &alpha);
324
+
325
+ float h = glm_clamp(NUM2FLT(hue), 0.0f, 360.0f);
326
+ float s = glm_clamp(NUM2FLT(saturation), 0.0f, 1.0f);
327
+ float b = glm_clamp(NUM2FLT(brightness), 0.0f, 1.0f);
328
+
329
+ float *color = RGSS_VEC4_NEW;
330
+ RGSS_Color_HSB2RGB(color, h, s, b);
331
+ color[3] = NIL_P(alpha) ? 1.0f : glm_clamp(NUM2FLT(alpha), 0.0f, 1.0f);
332
+
333
+ return Data_Wrap_Struct(klass, NULL, free, color);
334
+ }
335
+
336
+ static inline void RGSS_Color_HSL2HSB(float in_s, float in_l, float *out_s, float *out_b)
337
+ {
338
+ float t = in_s * (in_l < 0.5f ? in_l : 1.0f - in_l);
339
+ *out_b = in_l + t;
340
+ *out_s = in_l > 0.0f ? 2.0f * t / *out_b : *out_s;
341
+ }
342
+
343
+ static VALUE RGSS_Color_FromHSL(int argc, VALUE *argv, VALUE klass)
344
+ {
345
+ VALUE hue, saturation, lightness, alpha;
346
+ rb_scan_args(argc, argv, "31", &hue, &saturation, &lightness, &alpha);
347
+
348
+ float h = glm_clamp(NUM2FLT(hue), 0.0f, 360.0f);
349
+ float s = glm_clamp(NUM2FLT(saturation), 0.0f, 1.0f);
350
+ float l = glm_clamp(NUM2FLT(lightness), 0.0f, 1.0f);
351
+ float sat, b;
352
+
353
+ // Convert the saturation and lightness to be consistent with HSB/HSV, then compute
354
+ RGSS_Color_HSL2HSB(s, l, &sat, &b);
355
+
356
+ float *color = RGSS_VEC4_NEW;
357
+ RGSS_Color_HSB2RGB(color, h, sat, b);
358
+ color[3] = NIL_P(alpha) ? 1.0f : glm_clamp(NUM2FLT(alpha), 0.0f, 1.0f);
359
+ return Data_Wrap_Struct(klass, NULL, free, color);
360
+ }
361
+
362
+ static VALUE RGSS_Color_Multiply(VALUE self, VALUE scale)
363
+ {
364
+ float *color = DATA_PTR(self), *result = RGSS_VEC4_NEW;
365
+ float w = NUM2FLT(scale);
366
+ result[0] = glm_clamp(color[0] * w, 0.0f, 1.0f);
367
+ result[1] = glm_clamp(color[1] * w, 0.0f, 1.0f);
368
+ result[2] = glm_clamp(color[2] * w, 0.0f, 1.0f);
369
+ result[3] = glm_clamp(color[3] * w, 0.0f, 1.0f);
370
+ return Data_Wrap_Struct(CLASS_OF(self), NULL, free, result);
371
+ }
372
+
373
+ static VALUE RGSS_Color_Inverse(int argc, VALUE *argv, VALUE self)
374
+ {
375
+ VALUE include_alpha;
376
+ rb_scan_args(argc, argv, "01", &include_alpha);
377
+ float *color = DATA_PTR(self), *result = RGSS_VEC4_NEW;
378
+ result[0] = 1.0f - color[0];
379
+ result[1] = 1.0f - color[1];
380
+ result[2] = 1.0f - color[2];
381
+ result[3] = RTEST(include_alpha) ? 1.0f - color[3] : color[3];
382
+ return Data_Wrap_Struct(CLASS_OF(self), NULL, free, result);
383
+ }
384
+
385
+ void RGSS_Init_ColorAndTone(VALUE parent)
386
+ {
387
+ rb_cColor = rb_define_class_under(parent, "Color", rb_cObject);
388
+ rb_cTone = rb_define_class_under(parent, "Tone", rb_cObject);
389
+ rb_define_alloc_func(rb_cColor, RGSS_Color_Alloc);
390
+ rb_define_alloc_func(rb_cTone, RGSS_Color_Alloc);
391
+
392
+ rb_define_methodm1(rb_cColor, "initialize", RGSS_Color_Initialize, -1);
393
+ rb_define_method0(rb_cColor, "r", RGSS_Color_GetRed, 0);
394
+ rb_define_method0(rb_cColor, "g", RGSS_Color_GetGreen, 0);
395
+ rb_define_method0(rb_cColor, "b", RGSS_Color_GetBlue, 0);
396
+ rb_define_method0(rb_cColor, "a", RGSS_Color_GetAlpha, 0);
397
+ rb_define_method1(rb_cColor, "eql?", RGSS_Color_Equal, 1);
398
+ rb_define_method1(rb_cColor, "==", RGSS_Color_Equal, 1);
399
+ rb_define_method1(rb_cColor, "*", RGSS_Color_Multiply, 1);
400
+ rb_define_method0(rb_cColor, "inspect", RGSS_Color_Inspect, 0);
401
+ rb_define_method0(rb_cColor, "clone", RGSS_Color_Clone, 0);
402
+ rb_define_method0(rb_cColor, "dup", RGSS_Color_Clone, 0);
403
+ rb_define_method0(rb_cColor, "to_a", RGSS_Color_ToArray, 0);
404
+ rb_define_method0(rb_cColor, "to_h", RGSS_Color_ToHash, 0);
405
+ rb_define_methodm1(rb_cColor, "inverse", RGSS_Color_Inverse, -1);
406
+ rb_define_methodm1(rb_cColor, "_dump", RGSS_Color_Dump, -1);
407
+
408
+ rb_define_method0(rb_cColor, "hue", RGSS_Color_GetHue, 0);
409
+ rb_define_method0(rb_cColor, "saturation", RGSS_Color_GetSaturation, 0);
410
+ rb_define_method0(rb_cColor, "lightness", RGSS_Color_GetLightness, 0);
411
+ rb_define_method0(rb_cColor, "brightness", RGSS_Color_GetBrightness, 0);
412
+ rb_define_method0(rb_cColor, "hsl", RGSS_Color_GetHSL, 0);
413
+ rb_define_method0(rb_cColor, "hsb", RGSS_Color_GetHSB, 0);
414
+
415
+ rb_define_alias(rb_cColor, "multiply", "*");
416
+ rb_define_alias(rb_cColor, "red", "r");
417
+ rb_define_alias(rb_cColor, "green", "g");
418
+ rb_define_alias(rb_cColor, "blue", "b");
419
+ rb_define_alias(rb_cColor, "alpha", "a");
420
+ rb_define_alias(rb_cColor, "value", "brightness");
421
+ rb_define_alias(rb_cColor, "hsv", "hsb");
422
+ rb_define_singleton_method3(rb_cColor, "mix", RGSS_Color_Mix, 3);
423
+
424
+ rb_define_singleton_methodm1(rb_cColor, "from_hsl", RGSS_Color_FromHSL, -1);
425
+ rb_define_singleton_methodm1(rb_cColor, "from_hsb", RGSS_Color_FromHSB, -1);
426
+ rb_define_singleton_methodm1(rb_cColor, "from_hsv", RGSS_Color_FromHSB, -1);
427
+
428
+ rb_define_methodm1(rb_cTone, "initialize", RGSS_Tone_Initialize, -1);
429
+ rb_define_method0(rb_cTone, "r", RGSS_Color_GetRed, 0);
430
+ rb_define_method0(rb_cTone, "g", RGSS_Color_GetGreen, 0);
431
+ rb_define_method0(rb_cTone, "b", RGSS_Color_GetBlue, 0);
432
+ rb_define_method0(rb_cTone, "gray", RGSS_Color_GetAlpha, 0);
433
+ rb_define_method1(rb_cTone, "eql?", RGSS_Color_Equal, 1);
434
+ rb_define_method1(rb_cTone, "==", RGSS_Color_Equal, 1);
435
+ rb_define_method0(rb_cTone, "inspect", RGSS_Color_Inspect, 0);
436
+ rb_define_method0(rb_cTone, "clone", RGSS_Color_Clone, 0);
437
+ rb_define_method0(rb_cTone, "dup", RGSS_Color_Clone, 0);
438
+ rb_define_method0(rb_cTone, "to_a", RGSS_Color_ToArray, 0);
439
+ rb_define_method0(rb_cTone, "to_h", RGSS_Tone_ToHash, 0);
440
+ rb_define_methodm1(rb_cTone, "_dump", RGSS_Color_Dump, -1);
441
+
442
+ rb_define_alias(rb_cTone, "red", "r");
443
+ rb_define_alias(rb_cTone, "green", "g");
444
+ rb_define_alias(rb_cTone, "blue", "b");
445
+ rb_define_alias(rb_cTone, "grey", "gray");
446
+
447
+ rb_define_singleton_method1(rb_cColor, "_load", RGSS_Color_Load, 1);
448
+ rb_define_singleton_method1(rb_cTone, "_load", RGSS_Color_Load, 1);
449
+
450
+ float *gray = RGSS_VEC4_NEW;
451
+ glm_vec4_zero(gray);
452
+ gray[3] = 1.0f;
453
+ rb_define_const(rb_cTone, "GRAY", Data_Wrap_Struct(rb_cTone, NULL, free, gray));
454
+
455
+ #define COLOR_CONST(r, g, b, a, name) rb_define_const(rb_cColor, #name, RGSS_Color_New(rb_cColor, r, g, b, a))
456
+ COLOR_CONST(0.00000f, 0.00000f, 0.00000f, 0.00000f, NONE);
457
+ COLOR_CONST(1.00000f, 1.00000f, 1.00000f, 0.00000f, TRANSPARENT);
458
+ COLOR_CONST(0.94118f, 0.97255f, 1.00000f, 1.00000f, ALICE_BLUE);
459
+ COLOR_CONST(0.98039f, 0.92157f, 0.84314f, 1.00000f, ANTIQUE_WHITE);
460
+ COLOR_CONST(0.00000f, 1.00000f, 1.00000f, 1.00000f, AQUA);
461
+ COLOR_CONST(0.49804f, 1.00000f, 0.83137f, 1.00000f, AQUAMARINE);
462
+ COLOR_CONST(0.94118f, 1.00000f, 1.00000f, 1.00000f, AZURE);
463
+ COLOR_CONST(0.96078f, 0.96078f, 0.86275f, 1.00000f, BEIGE);
464
+ COLOR_CONST(1.00000f, 0.89412f, 0.76863f, 1.00000f, BISQUE);
465
+ COLOR_CONST(0.00000f, 0.00000f, 0.00000f, 1.00000f, BLACK);
466
+ COLOR_CONST(1.00000f, 0.92157f, 0.80392f, 1.00000f, BLANCHED_ALMOND);
467
+ COLOR_CONST(0.00000f, 0.00000f, 1.00000f, 1.00000f, BLUE);
468
+ COLOR_CONST(0.54118f, 0.16863f, 0.88627f, 1.00000f, BLUE_VIOLET);
469
+ COLOR_CONST(0.64706f, 0.16471f, 0.16471f, 1.00000f, BROWN);
470
+ COLOR_CONST(0.87059f, 0.72157f, 0.52941f, 1.00000f, BURLY_WOOD);
471
+ COLOR_CONST(0.37255f, 0.61961f, 0.62745f, 1.00000f, CADET_BLUE);
472
+ COLOR_CONST(0.49804f, 1.00000f, 0.00000f, 1.00000f, CHARTREUSE);
473
+ COLOR_CONST(0.82353f, 0.41176f, 0.11765f, 1.00000f, CHOCOLATE);
474
+ COLOR_CONST(1.00000f, 0.49804f, 0.31373f, 1.00000f, CORAL);
475
+ COLOR_CONST(0.39216f, 0.58431f, 0.92941f, 1.00000f, CORNFLOWER_BLUE);
476
+ COLOR_CONST(1.00000f, 0.97255f, 0.86275f, 1.00000f, CORNSILK);
477
+ COLOR_CONST(0.86275f, 0.07843f, 0.23529f, 1.00000f, CRIMSON);
478
+ COLOR_CONST(0.00000f, 1.00000f, 1.00000f, 1.00000f, CYAN);
479
+ COLOR_CONST(0.00000f, 0.00000f, 0.54510f, 1.00000f, DARK_BLUE);
480
+ COLOR_CONST(0.00000f, 0.54510f, 0.54510f, 1.00000f, DARK_CYAN);
481
+ COLOR_CONST(0.72157f, 0.52549f, 0.04314f, 1.00000f, DARK_GOLDENROD);
482
+ COLOR_CONST(0.66275f, 0.66275f, 0.66275f, 1.00000f, DARK_GRAY);
483
+ COLOR_CONST(0.00000f, 0.39216f, 0.00000f, 1.00000f, DARK_GREEN);
484
+ COLOR_CONST(0.74118f, 0.71765f, 0.41961f, 1.00000f, DARK_KHAKI);
485
+ COLOR_CONST(0.54510f, 0.00000f, 0.54510f, 1.00000f, DARK_MAGENTA);
486
+ COLOR_CONST(0.33333f, 0.41961f, 0.18431f, 1.00000f, DARK_OLIVE_GREEN);
487
+ COLOR_CONST(1.00000f, 0.54902f, 0.00000f, 1.00000f, DARK_ORANGE);
488
+ COLOR_CONST(0.60000f, 0.19608f, 0.80000f, 1.00000f, DARK_ORCHID);
489
+ COLOR_CONST(0.54510f, 0.00000f, 0.00000f, 1.00000f, DARK_RED);
490
+ COLOR_CONST(0.91373f, 0.58824f, 0.47843f, 1.00000f, DARK_SALMON);
491
+ COLOR_CONST(0.56078f, 0.73725f, 0.54510f, 1.00000f, DARK_SEA_GREEN);
492
+ COLOR_CONST(0.28235f, 0.23922f, 0.54510f, 1.00000f, DARK_SLATE_BLUE);
493
+ COLOR_CONST(0.18431f, 0.30980f, 0.30980f, 1.00000f, DARK_SLATE_GRAY);
494
+ COLOR_CONST(0.00000f, 0.80784f, 0.81961f, 1.00000f, DARK_TURQUOISE);
495
+ COLOR_CONST(0.58039f, 0.00000f, 0.82745f, 1.00000f, DARK_VIOLET);
496
+ COLOR_CONST(1.00000f, 0.07843f, 0.57647f, 1.00000f, DEEP_PINK);
497
+ COLOR_CONST(0.00000f, 0.74902f, 1.00000f, 1.00000f, DEEP_SKY_BLUE);
498
+ COLOR_CONST(0.41176f, 0.41176f, 0.41176f, 1.00000f, DIM_GRAY);
499
+ COLOR_CONST(0.11765f, 0.56471f, 1.00000f, 1.00000f, DODGER_BLUE);
500
+ COLOR_CONST(0.69804f, 0.13333f, 0.13333f, 1.00000f, FIREBRICK);
501
+ COLOR_CONST(1.00000f, 0.98039f, 0.94118f, 1.00000f, FLORAL_WHITE);
502
+ COLOR_CONST(0.13333f, 0.54510f, 0.13333f, 1.00000f, FOREST_GREEN);
503
+ COLOR_CONST(1.00000f, 0.00000f, 1.00000f, 1.00000f, FUCHSIA);
504
+ COLOR_CONST(0.86275f, 0.86275f, 0.86275f, 1.00000f, GAINSBORO);
505
+ COLOR_CONST(0.97255f, 0.97255f, 1.00000f, 1.00000f, GHOST_WHITE);
506
+ COLOR_CONST(1.00000f, 0.84314f, 0.00000f, 1.00000f, GOLD);
507
+ COLOR_CONST(0.85490f, 0.64706f, 0.12549f, 1.00000f, GOLDENROD);
508
+ COLOR_CONST(0.50196f, 0.50196f, 0.50196f, 1.00000f, GRAY);
509
+ COLOR_CONST(0.00000f, 0.50196f, 0.00000f, 1.00000f, GREEN);
510
+ COLOR_CONST(0.67843f, 1.00000f, 0.18431f, 1.00000f, GREEN_YELLOW);
511
+ COLOR_CONST(0.94118f, 1.00000f, 0.94118f, 1.00000f, HONEYDEW);
512
+ COLOR_CONST(1.00000f, 0.41176f, 0.70588f, 1.00000f, HOT_PINK);
513
+ COLOR_CONST(0.80392f, 0.36078f, 0.36078f, 1.00000f, INDIAN_RED);
514
+ COLOR_CONST(0.29412f, 0.00000f, 0.50980f, 1.00000f, INDIGO);
515
+ COLOR_CONST(1.00000f, 1.00000f, 0.94118f, 1.00000f, IVORY);
516
+ COLOR_CONST(0.94118f, 0.90196f, 0.54902f, 1.00000f, KHAKI);
517
+ COLOR_CONST(0.90196f, 0.90196f, 0.98039f, 1.00000f, LAVENDER);
518
+ COLOR_CONST(1.00000f, 0.94118f, 0.96078f, 1.00000f, LAVENDER_BLUSH);
519
+ COLOR_CONST(0.48627f, 0.98824f, 0.00000f, 1.00000f, LAWN_GREEN);
520
+ COLOR_CONST(1.00000f, 0.98039f, 0.80392f, 1.00000f, LEMON_CHIFFON);
521
+ COLOR_CONST(0.67843f, 0.84706f, 0.90196f, 1.00000f, LIGHT_BLUE);
522
+ COLOR_CONST(0.94118f, 0.50196f, 0.50196f, 1.00000f, LIGHT_CORAL);
523
+ COLOR_CONST(0.87843f, 1.00000f, 1.00000f, 1.00000f, LIGHT_CYAN);
524
+ COLOR_CONST(0.98039f, 0.98039f, 0.82353f, 1.00000f, LIGHT_GOLDENROD_YELLOW);
525
+ COLOR_CONST(0.82745f, 0.82745f, 0.82745f, 1.00000f, LIGHT_GRAY);
526
+ COLOR_CONST(0.56471f, 0.93333f, 0.56471f, 1.00000f, LIGHT_GREEN);
527
+ COLOR_CONST(1.00000f, 0.71373f, 0.75686f, 1.00000f, LIGHT_PINK);
528
+ COLOR_CONST(1.00000f, 0.62745f, 0.47843f, 1.00000f, LIGHT_SALMON);
529
+ COLOR_CONST(0.12549f, 0.69804f, 0.66667f, 1.00000f, LIGHT_SEA_GREEN);
530
+ COLOR_CONST(0.52941f, 0.80784f, 0.98039f, 1.00000f, LIGHT_SKY_BLUE);
531
+ COLOR_CONST(0.46667f, 0.53333f, 0.60000f, 1.00000f, LIGHT_SLATE_GRAY);
532
+ COLOR_CONST(0.69020f, 0.76863f, 0.87059f, 1.00000f, LIGHT_STEEL_BLUE);
533
+ COLOR_CONST(1.00000f, 1.00000f, 0.87843f, 1.00000f, LIGHT_YELLOW);
534
+ COLOR_CONST(0.00000f, 1.00000f, 0.00000f, 1.00000f, LIME);
535
+ COLOR_CONST(0.19608f, 0.80392f, 0.19608f, 1.00000f, LIME_GREEN);
536
+ COLOR_CONST(0.98039f, 0.94118f, 0.90196f, 1.00000f, LINEN);
537
+ COLOR_CONST(1.00000f, 0.00000f, 1.00000f, 1.00000f, MAGENTA);
538
+ COLOR_CONST(0.50196f, 0.00000f, 0.00000f, 1.00000f, MAROON);
539
+ COLOR_CONST(0.40000f, 0.80392f, 0.66667f, 1.00000f, MEDIUM_AQUAMARINE);
540
+ COLOR_CONST(0.00000f, 0.00000f, 0.80392f, 1.00000f, MEDIUM_BLUE);
541
+ COLOR_CONST(0.72941f, 0.33333f, 0.82745f, 1.00000f, MEDIUM_ORCHID);
542
+ COLOR_CONST(0.57647f, 0.43922f, 0.85882f, 1.00000f, MEDIUM_PURPLE);
543
+ COLOR_CONST(0.23529f, 0.70196f, 0.44314f, 1.00000f, MEDIUM_SEA_GREEN);
544
+ COLOR_CONST(0.48235f, 0.40784f, 0.93333f, 1.00000f, MEDIUM_SLATE_BLUE);
545
+ COLOR_CONST(0.00000f, 0.98039f, 0.60392f, 1.00000f, MEDIUM_SPRING_GREEN);
546
+ COLOR_CONST(0.28235f, 0.81961f, 0.80000f, 1.00000f, MEDIUM_TURQUOISE);
547
+ COLOR_CONST(0.78039f, 0.08235f, 0.52157f, 1.00000f, MEDIUM_VIOLET_RED);
548
+ COLOR_CONST(0.09804f, 0.09804f, 0.43922f, 1.00000f, MIDNIGHT_BLUE);
549
+ COLOR_CONST(0.96078f, 1.00000f, 0.98039f, 1.00000f, MINT_CREAM);
550
+ COLOR_CONST(1.00000f, 0.89412f, 0.88235f, 1.00000f, MISTY_ROSE);
551
+ COLOR_CONST(1.00000f, 0.89412f, 0.70980f, 1.00000f, MOCCASIN);
552
+ COLOR_CONST(1.00000f, 0.87059f, 0.67843f, 1.00000f, NAVAJO_WHITE);
553
+ COLOR_CONST(0.00000f, 0.00000f, 0.50196f, 1.00000f, NAVY);
554
+ COLOR_CONST(0.99216f, 0.96078f, 0.90196f, 1.00000f, OLD_LACE);
555
+ COLOR_CONST(0.50196f, 0.50196f, 0.00000f, 1.00000f, OLIVE);
556
+ COLOR_CONST(0.41961f, 0.55686f, 0.13725f, 1.00000f, OLIVE_DRAB);
557
+ COLOR_CONST(1.00000f, 0.64706f, 0.00000f, 1.00000f, ORANGE);
558
+ COLOR_CONST(1.00000f, 0.27059f, 0.00000f, 1.00000f, ORANGE_RED);
559
+ COLOR_CONST(0.85490f, 0.43922f, 0.83922f, 1.00000f, ORCHID);
560
+ COLOR_CONST(0.93333f, 0.90980f, 0.66667f, 1.00000f, PALE_GOLDENROD);
561
+ COLOR_CONST(0.59608f, 0.98431f, 0.59608f, 1.00000f, PALE_GREEN);
562
+ COLOR_CONST(0.68627f, 0.93333f, 0.93333f, 1.00000f, PALE_TURQUOISE);
563
+ COLOR_CONST(0.85882f, 0.43922f, 0.57647f, 1.00000f, PALE_VIOLET_RED);
564
+ COLOR_CONST(1.00000f, 0.93725f, 0.83529f, 1.00000f, PAPAYA_WHIP);
565
+ COLOR_CONST(1.00000f, 0.85490f, 0.72549f, 1.00000f, PEACH_PUFF);
566
+ COLOR_CONST(0.80392f, 0.52157f, 0.24706f, 1.00000f, PERU);
567
+ COLOR_CONST(1.00000f, 0.75294f, 0.79608f, 1.00000f, PINK);
568
+ COLOR_CONST(0.86667f, 0.62745f, 0.86667f, 1.00000f, PLUM);
569
+ COLOR_CONST(0.69020f, 0.87843f, 0.90196f, 1.00000f, POWDER_BLUE);
570
+ COLOR_CONST(0.50196f, 0.00000f, 0.50196f, 1.00000f, PURPLE);
571
+ COLOR_CONST(1.00000f, 0.00000f, 0.00000f, 1.00000f, RED);
572
+ COLOR_CONST(0.73725f, 0.56078f, 0.56078f, 1.00000f, ROSY_BROWN);
573
+ COLOR_CONST(0.25490f, 0.41176f, 0.88235f, 1.00000f, ROYAL_BLUE);
574
+ COLOR_CONST(0.54510f, 0.27059f, 0.07451f, 1.00000f, SADDLE_BROWN);
575
+ COLOR_CONST(0.98039f, 0.50196f, 0.44706f, 1.00000f, SALMON);
576
+ COLOR_CONST(0.95686f, 0.64314f, 0.37647f, 1.00000f, SANDY_BROWN);
577
+ COLOR_CONST(0.18039f, 0.54510f, 0.34118f, 1.00000f, SEA_GREEN);
578
+ COLOR_CONST(1.00000f, 0.96078f, 0.93333f, 1.00000f, SEA_SHELL);
579
+ COLOR_CONST(0.62745f, 0.32157f, 0.17647f, 1.00000f, SIENNA);
580
+ COLOR_CONST(0.75294f, 0.75294f, 0.75294f, 1.00000f, SILVER);
581
+ COLOR_CONST(0.52941f, 0.80784f, 0.92157f, 1.00000f, SKY_BLUE);
582
+ COLOR_CONST(0.41569f, 0.35294f, 0.80392f, 1.00000f, SLATE_BLUE);
583
+ COLOR_CONST(0.43922f, 0.50196f, 0.56471f, 1.00000f, SLATE_GRAY);
584
+ COLOR_CONST(1.00000f, 0.98039f, 0.98039f, 1.00000f, SNOW);
585
+ COLOR_CONST(0.00000f, 1.00000f, 0.49804f, 1.00000f, SPRING_GREEN);
586
+ COLOR_CONST(0.27451f, 0.50980f, 0.70588f, 1.00000f, STEEL_BLUE);
587
+ COLOR_CONST(0.82353f, 0.70588f, 0.54902f, 1.00000f, TAN);
588
+ COLOR_CONST(0.00000f, 0.50196f, 0.50196f, 1.00000f, TEAL);
589
+ COLOR_CONST(0.84706f, 0.74902f, 0.84706f, 1.00000f, THISTLE);
590
+ COLOR_CONST(1.00000f, 0.38824f, 0.27843f, 1.00000f, TOMATO);
591
+ COLOR_CONST(0.25098f, 0.87843f, 0.81569f, 1.00000f, TURQUOISE);
592
+ COLOR_CONST(0.93333f, 0.50980f, 0.93333f, 1.00000f, VIOLET);
593
+ COLOR_CONST(0.96078f, 0.87059f, 0.70196f, 1.00000f, WHEAT);
594
+ COLOR_CONST(1.00000f, 1.00000f, 1.00000f, 1.00000f, WHITE);
595
+ COLOR_CONST(0.96078f, 0.96078f, 0.96078f, 1.00000f, WHITE_SMOKE);
596
+ COLOR_CONST(1.00000f, 1.00000f, 0.00000f, 1.00000f, YELLOW);
597
+ COLOR_CONST(0.60392f, 0.80392f, 0.19608f, 1.00000f, YELLOW_GREEN);
598
+ #undef COLOR_CONST
599
+ }