MCPcopy Create free account
hub / github.com/AbyssEngine/AbyssEngineOld / Palette

Method Palette

src/Abyss/DataTypes/Palette.cpp:22–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20auto PaletteEntry::getSdlColor() const -> SDL_Color { return {red, green, blue, 255}; }
21
22Palette::Palette(const std::string_view path, const std::string_view name)
23 : _name(name) {
24 const auto bytes = Singletons::getFileProvider().loadBytes(path);
25
26 for (size_t i = 0; i < bytes.size(); i += 3) {
27 addEntry({
28 colorAdjust(static_cast<uint8_t>(bytes.at(i))),
29 colorAdjust(static_cast<uint8_t>(bytes.at(i + 1))),
30 colorAdjust(static_cast<uint8_t>(bytes.at(i + 2)))});
31 }
32}
33
34const std::string &Palette::getName() const { return _name; }
35

Callers

nothing calls this directly

Calls 2

loadBytesMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected