geode.ColorProvider is a shared index of named colors.
Mods define colors by id, and texture packs can then change them.
Use it for colors you want a texture pack to override.
Prefix the id with your mod id.
Colors use plain tables. RGBAColor is { r, g, b, a } and RGBColor is { r, g, b }.
Each field is 0 to 255. An unknown id reads as white.
geode.ColorProvider.define(id: string, color: RGBAColor) -> RGBAColorDefines a color for an id. Does nothing if the id is already defined. Returns the current color.
geode.ColorProvider.override(id: string, color: RGBAColor) -> RGBAColorOverrides the current color for an id. Returns the new color.
geode.ColorProvider.reset(id: string) -> RGBAColorResets a color back to its defined value. Returns that value.
geode.ColorProvider.color(id: string) -> RGBAColor
geode.ColorProvider.color3b(id: string) -> RGBColorcolor returns the current color for an id. color3b is the same but drops the alpha.
local modId = geode.Mod.getID()
local id = modId .. "/accent"
geode.ColorProvider.define(id, { r = 255, g = 128, b = 0, a = 255 })
local c = geode.ColorProvider.color(id)
print(c.r, c.g, c.b) -- 255 128 0
-- Override and restore.
geode.ColorProvider.override(id, { r = 0, g = 200, b = 255, a = 255 })
sprite:setColor(geode.ColorProvider.color3b(id))
local restored = geode.ColorProvider.reset(id)
print(restored.r, restored.g, restored.b, restored.a)src/bindings/geode/GeodeSmallBindings.cpp