MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / LoadClassColor

Function LoadClassColor

src/Core/Bindings/obe/Graphics/Graphics.cpp:24–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22 { "RotateHandle", obe::Graphics::SpriteHandlePointType::RotateHandle } });
23 }
24 void LoadClassColor(sol::state_view state)
25 {
26 sol::table GraphicsNamespace = state["obe"]["Graphics"].get<sol::table>();
27 sol::usertype<obe::Graphics::Color> bindColor
28 = GraphicsNamespace.new_usertype<obe::Graphics::Color>("Color",
29 sol::call_constructor,
30 sol::constructors<obe::Graphics::Color(),
31 obe::Graphics::Color(double, double, double),
32 obe::Graphics::Color(double, double, double, double),
33 obe::Graphics::Color(const std::string&),
34 obe::Graphics::Color(const obe::Graphics::Color&),
35 obe::Graphics::Color(const sf::Color&)>());
36 bindColor["fromString"] = &obe::Graphics::Color::fromString;
37 bindColor["fromName"] = sol::overload(
38 [](obe::Graphics::Color* self, std::string name) -> bool {
39 return self->fromName(name);
40 },
41 [](obe::Graphics::Color* self, std::string name, bool strict) -> bool {
42 return self->fromName(name, strict);
43 });
44 bindColor["fromHex"] = &obe::Graphics::Color::fromHex;
45 bindColor["fromRgb"]
46 = sol::overload([](obe::Graphics::Color* self, double r, double g,
47 double b) -> void { return self->fromRgb(r, g, b); },
48 [](obe::Graphics::Color* self, double r, double g, double b,
49 double a) -> void { return self->fromRgb(r, g, b, a); });
50 bindColor["fromHsv"] = &obe::Graphics::Color::fromHsv;
51 bindColor["toInteger"] = &obe::Graphics::Color::toInteger;
52 bindColor[sol::meta_function::equal_to] = &obe::Graphics::Color::operator==;
53 bindColor[sol::meta_function::addition] = &obe::Graphics::Color::operator+;
54 bindColor[sol::meta_function::subtraction] = sol::overload(
55 static_cast<obe::Graphics::Color (obe::Graphics::Color::*)(
56 const obe::Graphics::Color&) const>(&obe::Graphics::Color::operator-),
57 static_cast<obe::Graphics::Color (obe::Graphics::Color::*)() const>(
58 &obe::Graphics::Color::operator-));
59 bindColor[sol::meta_function::multiplication] = sol::overload(
60 static_cast<obe::Graphics::Color (obe::Graphics::Color::*)(
61 const obe::Graphics::Color&) const>(&obe::Graphics::Color::operator*),
62 static_cast<obe::Graphics::Color (obe::Graphics::Color::*)(double) const>(
63 &obe::Graphics::Color::operator*));
64 bindColor[sol::meta_function::division] = sol::overload(
65 static_cast<obe::Graphics::Color (obe::Graphics::Color::*)(
66 const obe::Graphics::Color&) const>(&obe::Graphics::Color::operator/),
67 static_cast<obe::Graphics::Color (obe::Graphics::Color::*)(double) const>(
68 &obe::Graphics::Color::operator/));
69 bindColor["operator sf::Color"] = &obe::Graphics::Color::operator sf::Color;
70 bindColor["r"] = &obe::Graphics::Color::r;
71 bindColor["g"] = &obe::Graphics::Color::g;
72 bindColor["b"] = &obe::Graphics::Color::b;
73 bindColor["a"] = &obe::Graphics::Color::a;
74 bindColor["AliceBlue"] = sol::var(obe::Graphics::Color::AliceBlue);
75 bindColor["AntiqueWhite"] = sol::var(obe::Graphics::Color::AntiqueWhite);
76 bindColor["Aqua"] = sol::var(obe::Graphics::Color::Aqua);
77 bindColor["Aquamarine"] = sol::var(obe::Graphics::Color::Aquamarine);
78 bindColor["Azure"] = sol::var(obe::Graphics::Color::Azure);
79 bindColor["Beige"] = sol::var(obe::Graphics::Color::Beige);
80 bindColor["Bisque"] = sol::var(obe::Graphics::Color::Bisque);
81 bindColor["Black"] = sol::var(obe::Graphics::Color::Black);

Callers

nothing calls this directly

Calls 5

overloadFunction · 0.85
ColorClass · 0.85
varFunction · 0.85
fromNameMethod · 0.80
fromRgbMethod · 0.80

Tested by

no test coverage detected