add color() function. This can be used as eg:

function foo() return color("AABBCC") end
  ...
  OnCommand=diffuse,foo()
This commit is contained in:
Glenn Maynard
2005-08-31 01:25:36 +00:00
parent f6fad2c5e3
commit 8eae1eb189
+15
View File
@@ -482,6 +482,21 @@ LuaFunction( scale, scale(FArg(1), FArg(2), FArg(3), FArg(4), FArg(5)) );
LuaFunction( clamp, clamp(FArg(1), FArg(2), FArg(3)) );
#include "RageTypes.h"
int LuaFunc_color( lua_State *L )
{
CString sColor = SArg(1);
RageColor c;
c.FromString( sColor );
LuaHelpers::Push( c.r, L );
LuaHelpers::Push( c.g, L );
LuaHelpers::Push( c.b, L );
LuaHelpers::Push( c.a, L );
return 4;
}
static LuaFunctionList g_color( "color", LuaFunc_color ); /* register it */
/*
* (c) 2004 Glenn Maynard
* All rights reserved.