Add ConvertRGBtoSNES for ImVec4 arg

This commit is contained in:
scawful
2023-12-19 18:41:21 -05:00
parent da4650cbd6
commit 9aaa91727d
2 changed files with 9 additions and 0 deletions

View File

@@ -60,6 +60,14 @@ uint16_t ConvertRGBtoSNES(const snes_color& color) {
return (blue * SNES_BLUE_SHIFT) + (green * SNES_GREEN_SHIFT) + red;
}
uint16_t ConvertRGBtoSNES(const ImVec4& color) {
snes_color new_color;
new_color.red = color.x * 255;
new_color.green = color.y * 255;
new_color.blue = color.z * 255;
return ConvertRGBtoSNES(new_color);
}
snes_color ConvertSNEStoRGB(uint16_t color_snes) {
snes_color result;

View File

@@ -34,6 +34,7 @@ struct snes_palette {
using snes_palette = struct snes_palette;
uint16_t ConvertRGBtoSNES(const snes_color& color);
uint16_t ConvertRGBtoSNES(const ImVec4& color);
snes_color ConvertSNEStoRGB(uint16_t snes_color);
/**