MCPcopy Create free account
hub / github.com/DFHack/dfhack / lua_dfhack_color

Function lua_dfhack_color

library/LuaTools.cpp:400–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398}
399
400static int lua_dfhack_color(lua_State *S)
401{
402 int cv = luaL_optint(S, 1, -1);
403
404 if (cv < -1 || cv > COLOR_MAX)
405 luaL_argerror(S, 1, "invalid color value");
406
407 color_ostream *out = Lua::GetOutput(S);
408 if (out) {
409 lua_pushinteger(S, (int)out->color());
410 out->color(color_ostream::color_value(cv));
411 return 1;
412 }
413 return 0;
414}
415
416static int lua_dfhack_is_interactive(lua_State *S)
417{

Callers

nothing calls this directly

Calls 4

luaL_argerrorFunction · 0.85
lua_pushintegerFunction · 0.85
color_valueEnum · 0.85
colorMethod · 0.45

Tested by

no test coverage detected