MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / from

Method from

source/core/StarLuaConverters.cpp:6–11  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4namespace Star {
5
6LuaValue 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
13Maybe<Color> LuaConverter<Color>::to(LuaEngine& engine, LuaValue const& v) {
14 if (auto t = v.ptr<LuaTable>()) {

Callers

nothing calls this directly

Calls 9

createArrayTableMethod · 0.80
redMethod · 0.80
greenMethod · 0.80
blueMethod · 0.80
createWrappedFunctionMethod · 0.80
createTableMethod · 0.60
alphaMethod · 0.45
sizeMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected