From 34e93fa95a464656b5e7742a74d9f76fd5a7e4d1 Mon Sep 17 00:00:00 2001 From: FabsTheFabs Date: Tue, 10 Sep 2024 07:25:11 +0100 Subject: [PATCH] color util (with just one function lol) --- source/funkin/util/FlxColorUtil.hx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 source/funkin/util/FlxColorUtil.hx diff --git a/source/funkin/util/FlxColorUtil.hx b/source/funkin/util/FlxColorUtil.hx new file mode 100644 index 000000000..429d536d8 --- /dev/null +++ b/source/funkin/util/FlxColorUtil.hx @@ -0,0 +1,22 @@ +package funkin.util; + +import flixel.util.FlxColor; + +/** + * Non inline FlxColor functions for use in hscript files + */ +class FlxColorUtil +{ + /** + * Get an interpolated color based on two different colors. + * + * @param Color1 The first color + * @param Color2 The second color + * @param Factor Value from 0 to 1 representing how much to shift Color1 toward Color2 + * @return The interpolated color + */ + public static function interpolate(Color1:FlxColor, Color2:FlxColor, Factor:Float = 0.5):FlxColor + { + return FlxColor.interpolate(Color1, Color2, Factor); + } +}