| 4 | namespace Star { |
| 5 | |
| 6 | LuaValue LuaConverter<Color>::from(LuaEngine& engine, Color const& c) { |
| 7 | if (c.alpha() == 255) |
| 8 | return engine.createArrayTable(initializer_list<uint8_t>{c.red(), c.green(), c.blue()}); |
| 9 | else |
| 10 | return engine.createArrayTable(initializer_list<uint8_t>{c.red(), c.green(), c.blue(), c.alpha()}); |
| 11 | } |
| 12 | |
| 13 | Maybe<Color> LuaConverter<Color>::to(LuaEngine& engine, LuaValue const& v) { |
| 14 | if (auto t = v.ptr<LuaTable>()) { |
nothing calls this directly
no test coverage detected