lua: Palette() ctor by default is a 256 colors palette

This commit is contained in:
David Capello 2018-09-10 14:34:35 -03:00
parent 4eefcaaa09
commit d8fb99576e

View File

@ -37,7 +37,8 @@ struct PaletteObj {
int Palette_new(lua_State* L)
{
int ncolors = lua_tointeger(L, 1);
push_new<PaletteObj>(L, nullptr, new Palette(0, ncolors));
push_new<PaletteObj>(L, nullptr,
new Palette(0, ncolors > 0 ? ncolors: 256));
return 1;
}