add color3b for convenience

This commit is contained in:
HJfod 2024-04-22 20:18:58 +03:00
parent 082ad7b260
commit f5f2a6450d
2 changed files with 9 additions and 0 deletions

View file

@ -104,5 +104,11 @@ namespace geode {
* @returns The value of the color, or ccWHITE if the ID doesn't exist
*/
cocos2d::ccColor4B color(std::string const& id) const;
/**
* Get the current value of a color as a ccColor3B
* @param id The ID of the color
* @returns The value of the color, or ccWHITE if the ID doesn't exist
*/
cocos2d::ccColor3B color3b(std::string const& id) const;
};
}

View file

@ -69,3 +69,6 @@ ccColor4B ColorProvider::color(std::string const& id) const {
return to4B(ccWHITE);
}
}
ccColor3B ColorProvider::color3b(std::string const& id) const {
return to3B(this->color(id));
}