2023-11-07 09:04:22 +00:00
|
|
|
package funkin.graphics.shaders;
|
2023-08-23 09:33:52 +00:00
|
|
|
|
|
|
|
import flixel.addons.display.FlxRuntimeShader;
|
|
|
|
import funkin.Paths;
|
|
|
|
import openfl.utils.Assets;
|
|
|
|
|
|
|
|
class HSVShader extends FlxRuntimeShader
|
|
|
|
{
|
|
|
|
public var hue(default, set):Float;
|
|
|
|
public var saturation(default, set):Float;
|
|
|
|
public var value(default, set):Float;
|
|
|
|
|
|
|
|
public function new()
|
|
|
|
{
|
|
|
|
super(Assets.getText(Paths.frag('hsv')));
|
2024-04-24 16:11:37 +00:00
|
|
|
FlxG.debugger.addTrackerProfile(new TrackerProfile(HSVShader, ['hue', 'saturation', 'value']));
|
2023-08-23 09:33:52 +00:00
|
|
|
hue = 1;
|
|
|
|
saturation = 1;
|
|
|
|
value = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|