Skip to content

Commit

Permalink
check 0x and make sure it's a hex color
Browse files Browse the repository at this point in the history
probably looks kinda shitty lol whatever
  • Loading branch information
LarryFrosty authored Oct 16, 2024
1 parent d246b0a commit 93ad099
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions source/psychlua/FunkinLua.hx
Original file line number Diff line number Diff line change
Expand Up @@ -565,11 +565,13 @@ class FunkinLua {
Lua_helper.add_callback(lua, "doTweenColor", function(tag:String, vars:String, targetColor:String, duration:Float, ?ease:String = 'linear') {
var penisExam:Dynamic = LuaUtils.tweenPrepare(tag, vars);
if(penisExam != null) {
targetColor = targetColor.trim();
var newColor:FlxColor = CoolUtil.colorFromString(targetColor);
if(targetColor.startsWith('0x') && targetColor.length == 8 || !FlxColor.colorLookup.exists(targetColor.toUpperCase()) && targetColor.length == 6) newColor.alphaFloat = penisExam.alpha;

var curColor:FlxColor = penisExam.color;
curColor.alphaFloat = penisExam.alpha;
var newColor:FlxColor = CoolUtil.colorFromString(targetColor);
if(targetColor.length == 6) newColor.alphaFloat = penisExam.alpha;


if(tag != null)
{
var originalTag:String = tag;
Expand Down

0 comments on commit 93ad099

Please sign in to comment.