Skip to content

Commit f18243a

Browse files
authored
closes #594
I didn't test this btw, this is just more of a quick hotfix
1 parent ba3c14c commit f18243a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

source/shaders/RGBPalette.hx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,29 @@ class RGBPalette {
1212

1313
private function set_r(color:FlxColor) {
1414
r = color;
15-
shader.r.value = [color.redFloat, color.greenFloat, color.blueFloat];
15+
if (shader != null)
16+
shader.r.value = [color.redFloat, color.greenFloat, color.blueFloat];
1617
return color;
1718
}
1819

1920
private function set_g(color:FlxColor) {
2021
g = color;
21-
shader.g.value = [color.redFloat, color.greenFloat, color.blueFloat];
22+
if (shader != null)
23+
shader.g.value = [color.redFloat, color.greenFloat, color.blueFloat];
2224
return color;
2325
}
2426

2527
private function set_b(color:FlxColor) {
2628
b = color;
27-
shader.b.value = [color.redFloat, color.greenFloat, color.blueFloat];
29+
if (shader != null)
30+
shader.b.value = [color.redFloat, color.greenFloat, color.blueFloat];
2831
return color;
2932
}
3033

3134
private function set_mult(value:Float) {
3235
mult = FlxMath.bound(value, 0, 1);
33-
shader.mult.value = [mult];
36+
if (shader != null)
37+
shader.mult.value = [mult];
3438
return mult;
3539
}
3640

0 commit comments

Comments
 (0)