Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions axmol/math/Color.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ struct AX_DLL Color32
return Color32{r, g, b, static_cast<uint8_t>(alpha)};
}

Color32 fromHex(unsigned int v)
Comment thread
aismann marked this conversation as resolved.
Outdated
{
r = static_cast<uint8_t>(v >> 16) & 0xff;
g = static_cast<uint8_t>(v >> 8) & 0xff;
b = static_cast<uint8_t>(v & 0xff);
return Color32{r, g, b};
}

void set(uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a)
{
r = _r;
Expand Down