Fix luax_optcolor;

This commit is contained in:
bjorn 2022-06-27 21:38:40 -07:00
parent e5d4ac10cb
commit af2c53a762
1 changed files with 1 additions and 1 deletions

View File

@ -440,7 +440,7 @@ void luax_optcolor(lua_State* L, int index, float color[4]) {
color[0] = color[1] = color[2] = color[3] = 1.f;
break;
case LUA_TNUMBER: {
uint32_t x = lua_tonumber(L, -1);
uint32_t x = lua_tonumber(L, index);
color[0] = ((x >> 16) & 0xff) / 255.f;
color[1] = ((x >> 8) & 0xff) / 255.f;
color[2] = ((x >> 0) & 0xff) / 255.f;