1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-09-04 04:38:09 +00:00
Funkin/source/funkin/graphics/shaders/HSVShader.hx

45 lines
941 B
Haxe
Raw Permalink Normal View History

package funkin.graphics.shaders;
2023-08-23 09:33:52 +00:00
import flixel.addons.display.FlxRuntimeShader;
2025-04-17 17:29:26 +00:00
@:nullSafety
2023-08-23 09:33:52 +00:00
class HSVShader extends FlxRuntimeShader
{
2025-04-17 17:29:26 +00:00
public var hue(default, set):Float = 1;
public var saturation(default, set):Float = 1;
public var value(default, set):Float = 1;
2023-08-23 09:33:52 +00:00
public function new(h:Float = 1, s:Float = 1, v:Float = 1)
2023-08-23 09:33:52 +00:00
{
super(Assets.getText(Paths.frag('hsv')));
2024-04-24 16:11:37 +00:00
FlxG.debugger.addTrackerProfile(new TrackerProfile(HSVShader, ['hue', 'saturation', 'value']));
hue = h;
saturation = s;
value = v;
2023-08-23 09:33:52 +00:00
}
function set_hue(value:Float):Float
{
2024-04-04 23:45:57 +00:00
this.setFloat('_hue', value);
2023-08-23 09:33:52 +00:00
this.hue = value;
return this.hue;
}
function set_saturation(value:Float):Float
{
2024-04-04 23:45:57 +00:00
this.setFloat('_sat', value);
2023-08-23 09:33:52 +00:00
this.saturation = value;
return this.saturation;
}
function set_value(value:Float):Float
{
2024-04-04 23:45:57 +00:00
this.setFloat('_val', value);
2023-08-23 09:33:52 +00:00
this.value = value;
return this.value;
}
}