diff --git a/src/PowderToyRenderer.cpp b/src/PowderToyRenderer.cpp index cca7cb714..b1159b25f 100644 --- a/src/PowderToyRenderer.cpp +++ b/src/PowderToyRenderer.cpp @@ -62,8 +62,8 @@ int main(int argc, char *argv[]) else { int w = Graphics::TextSize("Save file invalid").X + 15, x = (XRES-w)/2, y = (YRES-24)/2; - ren->DrawRect(RectSized(Vec2{ x, y }, Vec2{ w, 24 }), RGB(192, 192, 192)); - ren->BlendText({ x+8, y+8 }, "Save file invalid", RGBA(192, 192, 240, 255)); + ren->DrawRect(RectSized(Vec2{ x, y }, Vec2{ w, 24 }), 0xC0C0C0_rgb); + ren->BlendText({ x+8, y+8 }, "Save file invalid", 0xC0C0F0_rgb .WithAlpha(255)); } ren->RenderBegin(); diff --git a/src/debug/DebugLines.cpp b/src/debug/DebugLines.cpp index 17f943bb5..74d119595 100644 --- a/src/debug/DebugLines.cpp +++ b/src/debug/DebugLines.cpp @@ -22,24 +22,24 @@ void DebugLines::Draw() if (view->GetDrawSnap()) drawPoint2 = view->lineSnapCoords(drawPoint1, drawPoint2); - g->BlendLine({ 0, drawPoint1.Y }, { XRES, drawPoint1.Y }, RGBA(255, 255, 255, 120)); - g->BlendLine({ drawPoint1.X, 0 }, { drawPoint1.X, YRES }, RGBA(255, 255, 255, 120)); + g->BlendLine({ 0, drawPoint1.Y }, { XRES, drawPoint1.Y }, 0xFFFFFF_rgb .WithAlpha(120)); + g->BlendLine({ drawPoint1.X, 0 }, { drawPoint1.X, YRES }, 0xFFFFFF_rgb .WithAlpha(120)); - g->BlendLine({ 0, drawPoint2.Y }, { XRES, drawPoint2.Y }, RGBA(255, 255, 255, 120)); - g->BlendLine({ drawPoint2.X, 0 }, { drawPoint2.X, YRES }, RGBA(255, 255, 255, 120)); + g->BlendLine({ 0, drawPoint2.Y }, { XRES, drawPoint2.Y }, 0xFFFFFF_rgb .WithAlpha(120)); + g->BlendLine({ drawPoint2.X, 0 }, { drawPoint2.X, YRES }, 0xFFFFFF_rgb .WithAlpha(120)); String info; info = String::Build(drawPoint2.X, " x ", drawPoint2.Y); - g->BlendTextOutline({ drawPoint2.X+(drawPoint2.X>drawPoint1.X?3:-(g->TextSize(info).X-1)-3), drawPoint2.Y+(drawPoint2.Y(255, 255, 255, 200)); + g->BlendTextOutline({ drawPoint2.X+(drawPoint2.X>drawPoint1.X?3:-(g->TextSize(info).X-1)-3), drawPoint2.Y+(drawPoint2.YBlendTextOutline({ drawPoint1.X+(drawPoint2.XTextSize(info).X-1)-2), drawPoint1.Y+(drawPoint2.Y>drawPoint1.Y?-10:3) }, info, RGBA(255, 255, 255, 200)); + g->BlendTextOutline({ drawPoint1.X+(drawPoint2.XTextSize(info).X-1)-2), drawPoint1.Y+(drawPoint2.Y>drawPoint1.Y?-10:3) }, info, 0xFFFFFF_rgb .WithAlpha(200)); info = String::Build(std::abs(drawPoint2.X-drawPoint1.X)); - g->BlendTextOutline({ (drawPoint1.X+drawPoint2.X)/2-(g->TextSize(info).X-1)/2, drawPoint1.Y+(drawPoint2.Y>drawPoint1.Y?-10:3) }, info, RGBA(255, 255, 255, 200)); + g->BlendTextOutline({ (drawPoint1.X+drawPoint2.X)/2-(g->TextSize(info).X-1)/2, drawPoint1.Y+(drawPoint2.Y>drawPoint1.Y?-10:3) }, info, 0xFFFFFF_rgb .WithAlpha(200)); info = String::Build(std::abs(drawPoint2.Y-drawPoint1.Y)); - g->BlendTextOutline({ drawPoint1.X+(drawPoint2.XTextSize(info).X-1)-2), (drawPoint1.Y+drawPoint2.Y)/2-3 }, info, RGBA(255, 255, 255, 200)); + g->BlendTextOutline({ drawPoint1.X+(drawPoint2.XTextSize(info).X-1)-2), (drawPoint1.Y+drawPoint2.Y)/2-3 }, info, 0xFFFFFF_rgb .WithAlpha(200)); } } diff --git a/src/debug/DebugParts.cpp b/src/debug/DebugParts.cpp index 64bed4ac6..30748cd5b 100644 --- a/src/debug/DebugParts.cpp +++ b/src/debug/DebugParts.cpp @@ -22,9 +22,9 @@ void DebugParts::Draw() for (int i = 0; i < NPART; i++) { if (sim->parts[i].type) - g->AddPixel({ x, y }, RGBA(255, 255, 255, 180)); + g->AddPixel({ x, y }, 0xFFFFFF_rgb .WithAlpha(180)); else - g->AddPixel({ x, y }, RGBA(0, 0, 0, 180)); + g->AddPixel({ x, y }, 0x000000_rgb .WithAlpha(180)); if (i == sim->parts_lastActiveIndex) { @@ -38,17 +38,17 @@ void DebugParts::Draw() x = 0; } } - g->DrawLine({ 0, lpy }, { XRES, lpy }, RGB(0, 255, 120)); - g->DrawLine({ lpx, 0 }, { lpx, YRES }, RGB(0, 255, 120)); - g->AddPixel({ lpx, lpy }, RGBA(255, 50, 50, 220)); + g->DrawLine({ 0, lpy }, { XRES, lpy }, 0x00FF78_rgb); + g->DrawLine({ lpx, 0 }, { lpx, YRES }, 0x00FF78_rgb); + g->AddPixel({ lpx, lpy }, 0xFF3232_rgb .WithAlpha(220)); - g->AddPixel({ lpx+1, lpy }, RGBA(255, 50, 50, 120)); - g->AddPixel({ lpx-1, lpy }, RGBA(255, 50, 50, 120)); - g->AddPixel({ lpx, lpy+1 }, RGBA(255, 50, 50, 120)); - g->AddPixel({ lpx, lpy-1 }, RGBA(255, 50, 50, 120)); + g->AddPixel({ lpx+1, lpy }, 0xFF3232_rgb .WithAlpha(120)); + g->AddPixel({ lpx-1, lpy }, 0xFF3232_rgb .WithAlpha(120)); + g->AddPixel({ lpx, lpy+1 }, 0xFF3232_rgb .WithAlpha(120)); + g->AddPixel({ lpx, lpy-1 }, 0xFF3232_rgb .WithAlpha(120)); - g->BlendFilledRect(RectSized(Vec2{ 7, YRES-26}, Vec2{ g->TextSize(info).X + 4, 14}), RGBA(0, 0, 0, 180)); - g->BlendText({ 10, YRES-22 }, info, RGBA(255, 255, 255, 255)); + g->BlendFilledRect(RectSized(Vec2{ 7, YRES-26}, Vec2{ g->TextSize(info).X + 4, 14}), 0x000000_rgb .WithAlpha(180)); + g->BlendText({ 10, YRES-22 }, info, 0xFFFFFF_rgb .WithAlpha(255)); } DebugParts::~DebugParts() diff --git a/src/debug/ElementPopulation.cpp b/src/debug/ElementPopulation.cpp index 7767a1e3d..76ec04133 100644 --- a/src/debug/ElementPopulation.cpp +++ b/src/debug/ElementPopulation.cpp @@ -44,7 +44,7 @@ void ElementPopulationDebug::Draw() halfValString = String::Build(maxAverage/2); - g->BlendFilledRect(RectSized(Vec2{ xStart-5, yBottom - 263 }, Vec2{ bars+10+Graphics::TextSize(maxValString).X+9, 255 + 13 }), RGBA(0, 0, 0, 180)); + g->BlendFilledRect(RectSized(Vec2{ xStart-5, yBottom - 263 }, Vec2{ bars+10+Graphics::TextSize(maxValString).X+9, 255 + 13 }), 0x000000_rgb .WithAlpha(180)); bars = 0; for(int i = 0; i < PT_NUM; i++) @@ -68,7 +68,7 @@ void ElementPopulationDebug::Draw() g->DrawPixel({ xStart+barX, yBottom-barSize-7 }, colour); } else { - g->BlendLine({ xStart+barX, yBottom-barSize-3 }, { xStart+barX, yBottom-barSize-2 }, RGBA(255, 255, 255, 180)); + g->BlendLine({ xStart+barX, yBottom-barSize-3 }, { xStart+barX, yBottom-barSize-2 }, 0xFFFFFF_rgb .WithAlpha(180)); } g->DrawLine({ xStart+barX, yBottom-barSize }, { xStart+barX, yBottom }, colour); } @@ -76,9 +76,9 @@ void ElementPopulationDebug::Draw() } } - g->BlendText({ xStart + bars + 5, yBottom-5 }, "0", RGBA(255, 255, 255, 255)); - g->BlendText({ xStart + bars + 5, yBottom-132 }, halfValString, RGBA(255, 255, 255, 255)); - g->BlendText({ xStart + bars + 5, yBottom-260 }, maxValString, RGBA(255, 255, 255, 255)); + g->BlendText({ xStart + bars + 5, yBottom-5 }, "0", 0xFFFFFF_rgb .WithAlpha(255)); + g->BlendText({ xStart + bars + 5, yBottom-132 }, halfValString, 0xFFFFFF_rgb .WithAlpha(255)); + g->BlendText({ xStart + bars + 5, yBottom-260 }, maxValString, 0xFFFFFF_rgb .WithAlpha(255)); } ElementPopulationDebug::~ElementPopulationDebug() diff --git a/src/graphics/Graphics.cpp b/src/graphics/Graphics.cpp index 1622a0a91..c2ce36bf3 100644 --- a/src/graphics/Graphics.cpp +++ b/src/graphics/Graphics.cpp @@ -174,269 +174,269 @@ void Graphics::draw_icon(int x, int y, Icon icon, unsigned char alpha, bool inve { case IconOpen: if(invert) - BlendChar({ x, y }, 0xE001, RGBA(0, 0, 0, alpha)); + BlendChar({ x, y }, 0xE001, 0x000000_rgb .WithAlpha(alpha)); else - BlendChar({ x, y }, 0xE001, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y }, 0xE001, 0xFFFFFF_rgb .WithAlpha(alpha)); break; case IconReload: if(invert) - BlendChar({ x, y }, 0xE011, RGBA(0, 0, 0, alpha)); + BlendChar({ x, y }, 0xE011, 0x000000_rgb .WithAlpha(alpha)); else - BlendChar({ x, y }, 0xE011, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y }, 0xE011, 0xFFFFFF_rgb .WithAlpha(alpha)); break; case IconSave: if(invert) - BlendChar({ x, y }, 0xE002, RGBA(0, 0, 0, alpha)); + BlendChar({ x, y }, 0xE002, 0x000000_rgb .WithAlpha(alpha)); else - BlendChar({ x, y }, 0xE002, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y }, 0xE002, 0xFFFFFF_rgb .WithAlpha(alpha)); break; case IconVoteUp: if(invert) { - BlendChar({ x-11, y+1 }, 0xE04B, RGBA(0, 100, 0, alpha)); - BlendText({ x+2, y+1 }, "Vote", RGBA(0, 100, 0, alpha)); + BlendChar({ x-11, y+1 }, 0xE04B, 0x006400_rgb .WithAlpha(alpha)); + BlendText({ x+2, y+1 }, "Vote", 0x006400_rgb .WithAlpha(alpha)); } else { - BlendChar({ x-11, y+1 }, 0xE04B, RGBA(0, 187, 18, alpha)); - BlendText({ x+2, y+1 }, "Vote", RGBA(0, 187, 18, alpha)); + BlendChar({ x-11, y+1 }, 0xE04B, 0x00BB12_rgb .WithAlpha(alpha)); + BlendText({ x+2, y+1 }, "Vote", 0x00BB12_rgb .WithAlpha(alpha)); } break; case IconVoteDown: if(invert) - BlendChar({ x, y }, 0xE04A, RGBA(100, 10, 0, alpha)); + BlendChar({ x, y }, 0xE04A, 0x640A00_rgb .WithAlpha(alpha)); else - BlendChar({ x, y }, 0xE04A, RGBA(187, 40, 0, alpha)); + BlendChar({ x, y }, 0xE04A, 0xBB2800_rgb .WithAlpha(alpha)); break; case IconTag: if(invert) - BlendChar({ x, y }, 0xE003, RGBA(0, 0, 0, alpha)); + BlendChar({ x, y }, 0xE003, 0x000000_rgb .WithAlpha(alpha)); else - BlendChar({ x, y }, 0xE003, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y }, 0xE003, 0xFFFFFF_rgb .WithAlpha(alpha)); break; case IconNew: if(invert) - BlendChar({ x, y }, 0xE012, RGBA(0, 0, 0, alpha)); + BlendChar({ x, y }, 0xE012, 0x000000_rgb .WithAlpha(alpha)); else - BlendChar({ x, y }, 0xE012, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y }, 0xE012, 0xFFFFFF_rgb .WithAlpha(alpha)); break; case IconLogin: if(invert) - BlendChar({ x, y + 1 }, 0xE004, RGBA(0, 0, 0, alpha)); + BlendChar({ x, y + 1 }, 0xE004, 0x000000_rgb .WithAlpha(alpha)); else - BlendChar({ x, y + 1 }, 0xE004, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y + 1 }, 0xE004, 0xFFFFFF_rgb .WithAlpha(alpha)); break; case IconSimulationSettings: if(invert) - BlendChar({ x, y + 1 }, 0xE04F, RGBA(0, 0, 0, alpha)); + BlendChar({ x, y + 1 }, 0xE04F, 0x000000_rgb .WithAlpha(alpha)); else - BlendChar({ x, y + 1 }, 0xE04F, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y + 1 }, 0xE04F, 0xFFFFFF_rgb .WithAlpha(alpha)); break; case IconRenderSettings: if(invert) { - BlendChar({ x, y + 1 }, 0xE058, RGBA(255, 0, 0, alpha)); - BlendChar({ x, y + 1 }, 0xE059, RGBA(0, 255, 0, alpha)); - BlendChar({ x, y + 1 }, 0xE05A, RGBA(0, 0, 255, alpha)); + BlendChar({ x, y + 1 }, 0xE058, 0xFF0000_rgb .WithAlpha(alpha)); + BlendChar({ x, y + 1 }, 0xE059, 0x00FF00_rgb .WithAlpha(alpha)); + BlendChar({ x, y + 1 }, 0xE05A, 0x0000FF_rgb .WithAlpha(alpha)); } else { - AddChar({ x, y + 1 }, 0xE058, RGBA(255, 0, 0, alpha)); - AddChar({ x, y + 1 }, 0xE059, RGBA(0, 255, 0, alpha)); - AddChar({ x, y + 1 }, 0xE05A, RGBA(0, 0, 255, alpha)); + AddChar({ x, y + 1 }, 0xE058, 0xFF0000_rgb .WithAlpha(alpha)); + AddChar({ x, y + 1 }, 0xE059, 0x00FF00_rgb .WithAlpha(alpha)); + AddChar({ x, y + 1 }, 0xE05A, 0x0000FF_rgb .WithAlpha(alpha)); } break; case IconPause: if(invert) - BlendChar({ x, y }, 0xE010, RGBA(0, 0, 0, alpha)); + BlendChar({ x, y }, 0xE010, 0x000000_rgb .WithAlpha(alpha)); else - BlendChar({ x, y }, 0xE010, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y }, 0xE010, 0xFFFFFF_rgb .WithAlpha(alpha)); break; case IconFavourite: if(invert) - BlendChar({ x, y }, 0xE04C, RGBA(100, 80, 32, alpha)); + BlendChar({ x, y }, 0xE04C, 0x645020_rgb .WithAlpha(alpha)); else - BlendChar({ x, y }, 0xE04C, RGBA(192, 160, 64, alpha)); + BlendChar({ x, y }, 0xE04C, 0xC0A040_rgb .WithAlpha(alpha)); break; case IconReport: if(invert) - BlendChar({ x, y }, 0xE063, RGBA(140, 140, 0, alpha)); + BlendChar({ x, y }, 0xE063, 0x8C8C00_rgb .WithAlpha(alpha)); else - BlendChar({ x, y }, 0xE063, RGBA(255, 255, 0, alpha)); + BlendChar({ x, y }, 0xE063, 0xFFFF00_rgb .WithAlpha(alpha)); break; case IconUsername: if(invert) { - BlendChar({ x, y }, 0xE00B, RGBA(32, 64, 128, alpha)); - BlendChar({ x, y }, 0xE00A, RGBA(0, 0, 0, alpha)); + BlendChar({ x, y }, 0xE00B, 0x204080_rgb .WithAlpha(alpha)); + BlendChar({ x, y }, 0xE00A, 0x000000_rgb .WithAlpha(alpha)); } else { - BlendChar({ x, y }, 0xE00B, RGBA(32, 64, 128, alpha)); - BlendChar({ x, y }, 0xE00A, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y }, 0xE00B, 0x204080_rgb .WithAlpha(alpha)); + BlendChar({ x, y }, 0xE00A, 0xFFFFFF_rgb .WithAlpha(alpha)); } break; case IconPassword: if(invert) { - BlendChar({ x, y }, 0xE00C, RGBA(160, 144, 32, alpha)); - BlendChar({ x, y }, 0xE004, RGBA(0, 0, 0, alpha)); + BlendChar({ x, y }, 0xE00C, 0xA09020_rgb .WithAlpha(alpha)); + BlendChar({ x, y }, 0xE004, 0x000000_rgb .WithAlpha(alpha)); } else { - BlendChar({ x, y }, 0xE00C, RGBA(160, 144, 32, alpha)); - BlendChar({ x, y }, 0xE004, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y }, 0xE00C, 0xA09020_rgb .WithAlpha(alpha)); + BlendChar({ x, y }, 0xE004, 0xFFFFFF_rgb .WithAlpha(alpha)); } break; case IconClose: if(invert) - BlendChar({ x, y }, 0xE02A, RGBA(20, 20, 20, alpha)); + BlendChar({ x, y }, 0xE02A, 0x141414_rgb .WithAlpha(alpha)); else - BlendChar({ x, y }, 0xE02A, RGBA(230, 230, 230, alpha)); + BlendChar({ x, y }, 0xE02A, 0xE6E6E6_rgb .WithAlpha(alpha)); break; case IconVoteSort: if (invert) { - BlendChar({ x, y }, 0xE029, RGBA(44, 48, 32, alpha)); - BlendChar({ x, y }, 0xE028, RGBA(32, 44, 32, alpha)); - BlendChar({ x, y }, 0xE027, RGBA(128, 128, 128, alpha)); + BlendChar({ x, y }, 0xE029, 0x2C3020_rgb .WithAlpha(alpha)); + BlendChar({ x, y }, 0xE028, 0x202C20_rgb .WithAlpha(alpha)); + BlendChar({ x, y }, 0xE027, 0x808080_rgb .WithAlpha(alpha)); } else { - BlendChar({ x, y }, 0xE029, RGBA(144, 48, 32, alpha)); - BlendChar({ x, y }, 0xE028, RGBA(32, 144, 32, alpha)); - BlendChar({ x, y }, 0xE027, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y }, 0xE029, 0x903020_rgb .WithAlpha(alpha)); + BlendChar({ x, y }, 0xE028, 0x209020_rgb .WithAlpha(alpha)); + BlendChar({ x, y }, 0xE027, 0xFFFFFF_rgb .WithAlpha(alpha)); } break; case IconDateSort: if (invert) { - BlendChar({ x, y }, 0xE026, RGBA(32, 32, 32, alpha)); + BlendChar({ x, y }, 0xE026, 0x202020_rgb .WithAlpha(alpha)); } else { - BlendChar({ x, y }, 0xE026, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y }, 0xE026, 0xFFFFFF_rgb .WithAlpha(alpha)); } break; case IconMyOwn: if (invert) { - BlendChar({ x, y }, 0xE014, RGBA(192, 160, 64, alpha)); - BlendChar({ x, y }, 0xE013, RGBA(32, 32, 32, alpha)); + BlendChar({ x, y }, 0xE014, 0xC0A040_rgb .WithAlpha(alpha)); + BlendChar({ x, y }, 0xE013, 0x202020_rgb .WithAlpha(alpha)); } else { - BlendChar({ x, y }, 0xE014, RGBA(192, 160, 64, alpha)); - BlendChar({ x, y }, 0xE013, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y }, 0xE014, 0xC0A040_rgb .WithAlpha(alpha)); + BlendChar({ x, y }, 0xE013, 0xFFFFFF_rgb .WithAlpha(alpha)); } break; case IconSearch: - BlendChar({ x, y }, 0xE00E, RGBA(30, 30, 180, alpha)); - BlendChar({ x, y }, 0xE00F, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y }, 0xE00E, 0x1E1EB4_rgb .WithAlpha(alpha)); + BlendChar({ x, y }, 0xE00F, 0xFFFFFF_rgb .WithAlpha(alpha)); break; case IconDelete: if(invert) { - BlendChar({ x, y }, 0xE006, RGBA(159, 47, 31, alpha)); - BlendChar({ x, y }, 0xE005, RGBA(0, 0, 0, alpha)); + BlendChar({ x, y }, 0xE006, 0x9F2F1F_rgb .WithAlpha(alpha)); + BlendChar({ x, y }, 0xE005, 0x000000_rgb .WithAlpha(alpha)); } else { - BlendChar({ x, y }, 0xE006, RGBA(159, 47, 31, alpha)); - BlendChar({ x, y }, 0xE005, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y }, 0xE006, 0x9F2F1F_rgb .WithAlpha(alpha)); + BlendChar({ x, y }, 0xE005, 0xFFFFFF_rgb .WithAlpha(alpha)); } break; case IconAdd: if(invert) { - BlendChar({ x, y }, 0xE006, RGBA(32, 144, 32, alpha)); - BlendChar({ x, y }, 0xE009, RGBA(0, 0, 0, alpha)); + BlendChar({ x, y }, 0xE006, 0x209020_rgb .WithAlpha(alpha)); + BlendChar({ x, y }, 0xE009, 0x000000_rgb .WithAlpha(alpha)); } else { - BlendChar({ x, y }, 0xE006, RGBA(32, 144, 32, alpha)); - BlendChar({ x, y }, 0xE009, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y }, 0xE006, 0x209020_rgb .WithAlpha(alpha)); + BlendChar({ x, y }, 0xE009, 0xFFFFFF_rgb .WithAlpha(alpha)); } break; case IconVelocity: - BlendChar({ x + 1, y }, 0xE018, RGBA(128, 160, 255, alpha)); + BlendChar({ x + 1, y }, 0xE018, 0x80A0FF_rgb .WithAlpha(alpha)); break; case IconPressure: if(invert) - BlendChar({ x + 1, y + 1 }, 0xE019, RGBA(180, 160, 16, alpha)); + BlendChar({ x + 1, y + 1 }, 0xE019, 0xB4A010_rgb .WithAlpha(alpha)); else - BlendChar({ x + 1, y + 1 }, 0xE019, RGBA(255, 212, 32, alpha)); + BlendChar({ x + 1, y + 1 }, 0xE019, 0xFFD420_rgb .WithAlpha(alpha)); break; case IconPersistant: if(invert) - BlendChar({ x + 1, y + 1 }, 0xE01A, RGBA(20, 20, 20, alpha)); + BlendChar({ x + 1, y + 1 }, 0xE01A, 0x141414_rgb .WithAlpha(alpha)); else - BlendChar({ x + 1, y + 1 }, 0xE01A, RGBA(212, 212, 212, alpha)); + BlendChar({ x + 1, y + 1 }, 0xE01A, 0xD4D4D4_rgb .WithAlpha(alpha)); break; case IconFire: - BlendChar({ x + 1, y + 1 }, 0xE01B, RGBA(255, 0, 0, alpha)); - BlendChar({ x + 1, y + 1 }, 0xE01C, RGBA(255, 255, 64, alpha)); + BlendChar({ x + 1, y + 1 }, 0xE01B, 0xFF0000_rgb .WithAlpha(alpha)); + BlendChar({ x + 1, y + 1 }, 0xE01C, 0xFFFF40_rgb .WithAlpha(alpha)); break; case IconBlob: if(invert) - BlendChar({ x + 1, y }, 0xE03F, RGBA(55, 180, 55, alpha)); + BlendChar({ x + 1, y }, 0xE03F, 0x37B437_rgb .WithAlpha(alpha)); else - BlendChar({ x + 1, y }, 0xE03F, RGBA(55, 255, 55, alpha)); + BlendChar({ x + 1, y }, 0xE03F, 0x37FF37_rgb .WithAlpha(alpha)); break; case IconHeat: - BlendChar({ x + 3, y }, 0xE03E, RGBA(255, 0, 0, alpha)); + BlendChar({ x + 3, y }, 0xE03E, 0xFF0000_rgb .WithAlpha(alpha)); if(invert) - BlendChar({ x + 3, y }, 0xE03D, RGBA(0, 0, 0, alpha)); + BlendChar({ x + 3, y }, 0xE03D, 0x000000_rgb .WithAlpha(alpha)); else - BlendChar({ x + 3, y }, 0xE03D, RGBA(255, 255, 255, alpha)); + BlendChar({ x + 3, y }, 0xE03D, 0xFFFFFF_rgb .WithAlpha(alpha)); break; case IconBlur: if(invert) - BlendChar({ x + 1, y }, 0xE044, RGBA(50, 70, 180, alpha)); + BlendChar({ x + 1, y }, 0xE044, 0x3246B4_rgb .WithAlpha(alpha)); else - BlendChar({ x + 1, y }, 0xE044, RGBA(100, 150, 255, alpha)); + BlendChar({ x + 1, y }, 0xE044, 0x6496FF_rgb .WithAlpha(alpha)); break; case IconGradient: if(invert) - BlendChar({ x + 1, y + 1 }, 0xE053, RGBA(255, 50, 255, alpha)); + BlendChar({ x + 1, y + 1 }, 0xE053, 0xFF32FF_rgb .WithAlpha(alpha)); else - BlendChar({ x + 1, y + 1 }, 0xE053, RGBA(205, 50, 205, alpha)); + BlendChar({ x + 1, y + 1 }, 0xE053, 0xCD32CD_rgb .WithAlpha(alpha)); break; case IconLife: if(invert) - BlendChar({ x, y + 1 }, 0xE060, RGBA(0, 0, 0, alpha)); + BlendChar({ x, y + 1 }, 0xE060, 0x000000_rgb .WithAlpha(alpha)); else - BlendChar({ x, y + 1 }, 0xE060, RGBA(255, 255, 255, alpha)); + BlendChar({ x, y + 1 }, 0xE060, 0xFFFFFF_rgb .WithAlpha(alpha)); break; case IconEffect: - BlendChar({ x + 1, y }, 0xE061, RGBA(255, 255, 160, alpha)); + BlendChar({ x + 1, y }, 0xE061, 0xFFFFA0_rgb .WithAlpha(alpha)); break; case IconGlow: - BlendChar({ x + 1, y }, 0xE05F, RGBA(200, 255, 255, alpha)); + BlendChar({ x + 1, y }, 0xE05F, 0xC8FFFF_rgb .WithAlpha(alpha)); break; case IconWarp: - BlendChar({ x + 1, y }, 0xE05E, RGBA(255, 255, 255, alpha)); + BlendChar({ x + 1, y }, 0xE05E, 0xFFFFFF_rgb .WithAlpha(alpha)); break; case IconBasic: if(invert) - BlendChar({ x + 1, y + 1 }, 0xE05B, RGBA(50, 50, 0, alpha)); + BlendChar({ x + 1, y + 1 }, 0xE05B, 0x323200_rgb .WithAlpha(alpha)); else - BlendChar({ x + 1, y + 1 }, 0xE05B, RGBA(255, 255, 200, alpha)); + BlendChar({ x + 1, y + 1 }, 0xE05B, 0xFFFFC8_rgb .WithAlpha(alpha)); break; case IconAltAir: if(invert) { - BlendChar({ x + 1, y + 1 }, 0xE054, RGBA(180, 55, 55, alpha)); - BlendChar({ x + 1, y + 1 }, 0xE055, RGBA(55, 180, 55, alpha)); + BlendChar({ x + 1, y + 1 }, 0xE054, 0xB43737_rgb .WithAlpha(alpha)); + BlendChar({ x + 1, y + 1 }, 0xE055, 0x37B437_rgb .WithAlpha(alpha)); } else { - BlendChar({ x + 1, y + 1 }, 0xE054, RGBA(255, 55, 55, alpha)); - BlendChar({ x + 1, y + 1 }, 0xE055, RGBA(55, 255, 55, alpha)); + BlendChar({ x + 1, y + 1 }, 0xE054, 0xFF3737_rgb .WithAlpha(alpha)); + BlendChar({ x + 1, y + 1 }, 0xE055, 0x37FF37_rgb .WithAlpha(alpha)); } break; default: if(invert) - BlendChar({ x, y }, 't', RGBA(0, 0, 0, alpha)); + BlendChar({ x, y }, 't', 0x000000_rgb .WithAlpha(alpha)); else - BlendChar({ x, y }, 't', RGBA(255, 255, 255, alpha)); + BlendChar({ x, y }, 't', 0xFFFFFF_rgb .WithAlpha(alpha)); break; } } diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp index aa29a4e3c..513aff724 100644 --- a/src/graphics/Renderer.cpp +++ b/src/graphics/Renderer.cpp @@ -151,8 +151,8 @@ void Renderer::DrawSigns() { String text = currentSign.getDisplayText(sim, x, y, w, h); DrawFilledRect(RectSized(Vec2{ x + 1, y + 1 }, Vec2{ w, h - 1 }), 0x000000_rgb); - DrawRect(RectSized(Vec2{ x, y }, Vec2{ w+1, h }), RGB(192, 192, 192)); - BlendText({ x+3, y+4 }, text, RGBA(255, 255, 255, 255)); + DrawRect(RectSized(Vec2{ x, y }, Vec2{ w+1, h }), 0xC0C0C0_rgb); + BlendText({ x+3, y+4 }, text, 0xFFFFFF_rgb .WithAlpha(255)); if (currentSign.ju != sign::None) { @@ -162,7 +162,7 @@ void Renderer::DrawSigns() int dy = (currentSign.y > 18) ? -1 : 1; for (int j = 0; j < 4; j++) { - DrawPixel({ x, y }, RGB(192, 192, 192)); + DrawPixel({ x, y }, 0xC0C0C0_rgb); x += dx; y += dy; } @@ -188,9 +188,9 @@ void Renderer::render_parts() for (nx=0; nx(100, 100, 100, 80)); + BlendPixel({ nx, ny }, 0x646464_rgb .WithAlpha(80)); if (nx%(4*gridSize) == 0 && ny%(4*gridSize) != 0) - BlendPixel({ nx, ny }, RGBA(100, 100, 100, 80)); + BlendPixel({ nx, ny }, 0x646464_rgb .WithAlpha(80)); } } foundElements = 0; @@ -417,7 +417,7 @@ void Renderer::render_parts() if (mousePos.X>(nx-3) && mousePos.X<(nx+3) && mousePos.Y<(ny+3) && mousePos.Y>(ny-3)) //If mouse is in the head { String hp = String::Build(Format::Width(sim->parts[i].life, 3)); - BlendText(mousePos + Vec2{ -8-2*(sim->parts[i].life<100)-2*(sim->parts[i].life<10), -12 }, hp, RGBA(255, 255, 255, 255)); + BlendText(mousePos + Vec2{ -8-2*(sim->parts[i].life<100)-2*(sim->parts[i].life<10), -12 }, hp, 0xFFFFFF_rgb .WithAlpha(255)); } if (findingElement == t) @@ -510,9 +510,9 @@ void Renderer::render_parts() int nx = int(cplayer->legs[leg*8+4]), ny = int(cplayer->legs[leg*8+5]); int colr = 255, colg = 0, colb = 255; if (((int)(cplayer->comm)&0x04) == 0x04 || (((int)(cplayer->comm)&0x01) == 0x01 && leg==0) || (((int)(cplayer->comm)&0x02) == 0x02 && leg==1)) - DrawPixel({ nx, ny }, RGB(0, 255, 0)); + DrawPixel({ nx, ny }, 0x00FF00_rgb); else - DrawPixel({ nx, ny }, RGB(255, 0, 0)); + DrawPixel({ nx, ny }, 0xFF0000_rgb); BlendPixel({ nx+1, ny }, RGBA(colr, colg, colb, 223)); BlendPixel({ nx-1, ny }, RGBA(colr, colg, colb, 223)); BlendPixel({ nx, ny+1 }, RGBA(colr, colg, colb, 223)); @@ -778,9 +778,9 @@ void Renderer::draw_grav_zones() for (j=0; j(255, 200, 0, 120)); + BlendPixel({ x*CELL+i, y*CELL+j }, 0xFFC800_rgb .WithAlpha(120)); else - BlendPixel({ x*CELL+i, y*CELL+j }, RGBA(32, 32, 32, 120)); + BlendPixel({ x*CELL+i, y*CELL+j }, 0x202020_rgb .WithAlpha(120)); } } } @@ -808,7 +808,7 @@ void Renderer::draw_grav() { nx -= sim->gravx[ca]*0.5f; ny -= sim->gravy[ca]*0.5f; - AddPixel({ int(nx+0.5f), int(ny+0.5f) }, RGBA(255, 255, 255, (int)(dist*20.0f))); + AddPixel({ int(nx+0.5f), int(ny+0.5f) }, 0xFFFFFF_rgb .WithAlpha(int(dist*20.0f))); } } } @@ -979,8 +979,8 @@ void Renderer::DrawWalls() // there is no velocity here, draw a streamline and continue if (!xVel && !yVel) { - BlendText({ x*CELL, y*CELL-2 }, 0xE00D, RGBA(255, 255, 255, 128)); - AddPixel({ oldX, oldY }, RGBA(255, 255, 255, 255)); + BlendText({ x*CELL, y*CELL-2 }, 0xE00D, 0xFFFFFF_rgb .WithAlpha(128)); + AddPixel({ oldX, oldY }, 0xFFFFFF_rgb .WithAlpha(255)); continue; } bool changed = false; @@ -996,7 +996,7 @@ void Renderer::DrawWalls() } if (changed && (newX<0 || newX>=XRES || newY<0 || newY>=YRES)) break; - AddPixel({ newX, newY }, RGBA(255, 255, 255, 64)); + AddPixel({ newX, newY }, 0xFFFFFF_rgb .WithAlpha(64)); // cache velocity and other checks so we aren't running them constantly if (changed) { @@ -1010,7 +1010,7 @@ void Renderer::DrawWalls() xf += xVel; yf += yVel; } - BlendText({ x*CELL, y*CELL-2 }, 0xE00D, RGBA(255, 255, 255, 128)); + BlendText({ x*CELL, y*CELL-2 }, 0xE00D, 0xFFFFFF_rgb .WithAlpha(128)); } break; case 1: diff --git a/src/graphics/RendererBasic.cpp b/src/graphics/RendererBasic.cpp index 9e8d484bd..edf0c6568 100644 --- a/src/graphics/RendererBasic.cpp +++ b/src/graphics/RendererBasic.cpp @@ -71,8 +71,8 @@ void Renderer::RenderZoom() pixel pix; DrawFilledRect(RectSized(zoomWindowPosition, { zoomScopeSize * ZFACTOR, zoomScopeSize * ZFACTOR }), 0x000000_rgb); - DrawRect(RectSized(zoomWindowPosition - Vec2{ 2, 2 }, Vec2{ zoomScopeSize*ZFACTOR+3, zoomScopeSize*ZFACTOR+3 }), RGB(192, 192, 192)); - DrawRect(RectSized(zoomWindowPosition - Vec2{ 1, 1 }, Vec2{ zoomScopeSize*ZFACTOR+1, zoomScopeSize*ZFACTOR+1 }), RGB(0, 0, 0)); + DrawRect(RectSized(zoomWindowPosition - Vec2{ 2, 2 }, Vec2{ zoomScopeSize*ZFACTOR+3, zoomScopeSize*ZFACTOR+3 }), 0xC0C0C0_rgb); + DrawRect(RectSized(zoomWindowPosition - Vec2{ 1, 1 }, Vec2{ zoomScopeSize*ZFACTOR+1, zoomScopeSize*ZFACTOR+1 }), 0x000000_rgb); for (j=0; jBlendFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), RGBA(0, 0, 0, currentAlpha)); - g->DrawRect(RectSized(Position, Size), RGB(255, 255, 255)); + g->BlendFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb .WithAlpha(currentAlpha)); + g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb); - g->DrawRect(RectSized(Position + Vec2{ 4, 4 }, Vec2{ 258, 130 }), RGB(180, 180, 180)); + g->DrawRect(RectSized(Position + Vec2{ 4, 4 }, Vec2{ 258, 130 }), 0xB4B4B4_rgb); auto offset = Position + Vec2{ 5, 5 }; diff --git a/src/gui/console/ConsoleView.cpp b/src/gui/console/ConsoleView.cpp index b3ec8ddd6..c17d1de88 100644 --- a/src/gui/console/ConsoleView.cpp +++ b/src/gui/console/ConsoleView.cpp @@ -110,9 +110,9 @@ void ConsoleView::NotifyCurrentCommandChanged(ConsoleModel * sender) void ConsoleView::OnDraw() { Graphics * g = GetGraphics(); - g->BlendFilledRect(RectSized(Position, Size), RGBA(0, 0, 0, 110)); - g->BlendLine(Position + Vec2{ 0, Size.Y-16 }, Position + Size - Vec2{ 0, 16 }, RGBA(255, 255, 255, 160)); - g->BlendLine(Position + Vec2{ 0, Size.Y }, Position + Size, RGBA(255, 255, 255, 200)); + g->BlendFilledRect(RectSized(Position, Size), 0x000000_rgb .WithAlpha(110)); + g->BlendLine(Position + Vec2{ 0, Size.Y-16 }, Position + Size - Vec2{ 0, 16 }, 0xFFFFFF_rgb .WithAlpha(160)); + g->BlendLine(Position + Vec2{ 0, Size.Y }, Position + Size, 0xFFFFFF_rgb .WithAlpha(200)); } void ConsoleView::OnTick(float dt) diff --git a/src/gui/dialogues/ConfirmPrompt.cpp b/src/gui/dialogues/ConfirmPrompt.cpp index 48a05221b..845b4e8b6 100644 --- a/src/gui/dialogues/ConfirmPrompt.cpp +++ b/src/gui/dialogues/ConfirmPrompt.cpp @@ -83,5 +83,5 @@ void ConfirmPrompt::OnDraw() Graphics * g = GetGraphics(); g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(200, 200, 200)); + g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb); } diff --git a/src/gui/dialogues/ErrorMessage.cpp b/src/gui/dialogues/ErrorMessage.cpp index 859b79327..15a726d1b 100644 --- a/src/gui/dialogues/ErrorMessage.cpp +++ b/src/gui/dialogues/ErrorMessage.cpp @@ -59,5 +59,5 @@ void ErrorMessage::OnDraw() Graphics * g = GetGraphics(); g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(200, 200, 200)); + g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb); } diff --git a/src/gui/dialogues/InformationMessage.cpp b/src/gui/dialogues/InformationMessage.cpp index c8238be97..20d283bee 100644 --- a/src/gui/dialogues/InformationMessage.cpp +++ b/src/gui/dialogues/InformationMessage.cpp @@ -75,5 +75,5 @@ void InformationMessage::OnDraw() Graphics * g = GetGraphics(); g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(200, 200, 200)); + g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb); } diff --git a/src/gui/dialogues/SaveIDMessage.cpp b/src/gui/dialogues/SaveIDMessage.cpp index 06ecc96b4..bf48d1f5b 100644 --- a/src/gui/dialogues/SaveIDMessage.cpp +++ b/src/gui/dialogues/SaveIDMessage.cpp @@ -53,7 +53,7 @@ void SaveIDMessage::OnDraw() Graphics * g = GetGraphics(); g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(200, 200, 200)); + g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb); } void SaveIDMessage::OnTryExit(ExitMethod method) diff --git a/src/gui/dialogues/TextPrompt.cpp b/src/gui/dialogues/TextPrompt.cpp index fe961a7d0..cd5b7a490 100644 --- a/src/gui/dialogues/TextPrompt.cpp +++ b/src/gui/dialogues/TextPrompt.cpp @@ -94,5 +94,5 @@ void TextPrompt::OnDraw() Graphics * g = GetGraphics(); g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(200, 200, 200)); + g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb); } diff --git a/src/gui/elementsearch/ElementSearchActivity.cpp b/src/gui/elementsearch/ElementSearchActivity.cpp index 3dbf960e9..f0f86e94b 100644 --- a/src/gui/elementsearch/ElementSearchActivity.cpp +++ b/src/gui/elementsearch/ElementSearchActivity.cpp @@ -213,15 +213,15 @@ void ElementSearchActivity::OnDraw() { Graphics * g = GetGraphics(); g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(255, 255, 255)); + g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb); g->BlendRect( RectSized(Position + searchField->Position + Vec2{ 0, searchField->Size.Y+8 }, { searchField->Size.X, Size.Y-(searchField->Position.Y+searchField->Size.Y+8)-23 }), - RGBA(255, 255, 255, 180)); + 0xFFFFFF_rgb .WithAlpha(180)); if (toolTipPresence && toolTip.length()) { - g->BlendText({ 10, Size.Y+70 }, toolTip, RGBA(255, 255, 255, toolTipPresence>51?255:toolTipPresence*5)); + g->BlendText({ 10, Size.Y+70 }, toolTip, 0xFFFFFF_rgb .WithAlpha(toolTipPresence>51?255:toolTipPresence*5)); } } diff --git a/src/gui/filebrowser/FileBrowserActivity.cpp b/src/gui/filebrowser/FileBrowserActivity.cpp index 0e5b4a0c0..5a8bf4572 100644 --- a/src/gui/filebrowser/FileBrowserActivity.cpp +++ b/src/gui/filebrowser/FileBrowserActivity.cpp @@ -304,7 +304,7 @@ void FileBrowserActivity::OnDraw() //Window Background+Outline g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(255, 255, 255)); + g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb); } FileBrowserActivity::~FileBrowserActivity() diff --git a/src/gui/font/FontEditor.cpp b/src/gui/font/FontEditor.cpp index b28798bb0..b7ce036e1 100644 --- a/src/gui/font/FontEditor.cpp +++ b/src/gui/font/FontEditor.cpp @@ -491,19 +491,19 @@ void FontEditor::OnDraw() if(rulers) { - g->DrawLine({ 0, 7 + 0 * FONT_SCALE }, { areaWidth - 1, 7 + 0 * FONT_SCALE }, RGB(128, 128, 128)); - g->DrawLine({ 0, 7 + 2 * FONT_SCALE }, { areaWidth - 1, 7 + 2 * FONT_SCALE }, RGB(128, 128, 128)); - g->DrawLine({ 0, 7 + 4 * FONT_SCALE }, { areaWidth - 1, 7 + 4 * FONT_SCALE }, RGB(128, 128, 128)); - g->DrawLine({ 0, 7 + 9 * FONT_SCALE }, { areaWidth - 1, 7 + 9 * FONT_SCALE }, RGB(128, 128, 128)); - g->DrawLine({ 0, 7 + 12 * FONT_SCALE }, { areaWidth - 1, 7 + 12 * FONT_SCALE }, RGB(128, 128, 128)); + g->DrawLine({ 0, 7 + 0 * FONT_SCALE }, { areaWidth - 1, 7 + 0 * FONT_SCALE }, 0x808080_rgb); + g->DrawLine({ 0, 7 + 2 * FONT_SCALE }, { areaWidth - 1, 7 + 2 * FONT_SCALE }, 0x808080_rgb); + g->DrawLine({ 0, 7 + 4 * FONT_SCALE }, { areaWidth - 1, 7 + 4 * FONT_SCALE }, 0x808080_rgb); + g->DrawLine({ 0, 7 + 9 * FONT_SCALE }, { areaWidth - 1, 7 + 9 * FONT_SCALE }, 0x808080_rgb); + g->DrawLine({ 0, 7 + 12 * FONT_SCALE }, { areaWidth - 1, 7 + 12 * FONT_SCALE }, 0x808080_rgb); - g->DrawLine({ 7, 8 }, { 7, 7 + FONT_H * FONT_SCALE }, RGB(128, 128, 128)); - g->DrawLine({ 7 + width * FONT_SCALE, 8}, { 7 + width * FONT_SCALE, 7 + FONT_H * FONT_SCALE }, RGB(128, 128, 128)); + g->DrawLine({ 7, 8 }, { 7, 7 + FONT_H * FONT_SCALE }, 0x808080_rgb); + g->DrawLine({ 7 + width * FONT_SCALE, 8}, { 7 + width * FONT_SCALE, 7 + FONT_H * FONT_SCALE }, 0x808080_rgb); } } else { - g->BlendText({ 8, 8 }, "No character", RGBA(255, 0, 0, 255)); + g->BlendText({ 8, 8 }, "No character", 0xFF0000_rgb .WithAlpha(255)); } } diff --git a/src/gui/game/GOLTool.cpp b/src/gui/game/GOLTool.cpp index a837a63d9..19381f19c 100644 --- a/src/gui/game/GOLTool.cpp +++ b/src/gui/game/GOLTool.cpp @@ -186,7 +186,7 @@ void GOLWindow::OnDraw() Graphics * g = GetGraphics(); g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(200, 200, 200)); + g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb); int width = Size.X - 60; for (int xx = 0; xx < width; ++xx) diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index f791cbd09..948eb6588 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -153,7 +153,7 @@ public: drawn = true; if(showSplit) - g->DrawLine(screenPos + Vec2{ splitPosition, 1 }, screenPos + Vec2{ splitPosition, Size.Y-2 }, RGB(180, 180, 180)); + g->DrawLine(screenPos + Vec2{ splitPosition, 1 }, screenPos + Vec2{ splitPosition, Size.Y-2 }, 0xB4B4B4_rgb); } }; @@ -2139,7 +2139,7 @@ void GameView::OnDraw() { if(selectPoint1.X==-1) { - ren->BlendFilledRect(RectSized(Vec2{ 0, 0 }, Vec2{ XRES, YRES }), RGBA(0, 0, 0, 100)); + ren->BlendFilledRect(RectSized(Vec2{ 0, 0 }, Vec2{ XRES, YRES }), 0x000000_rgb .WithAlpha(100)); } else { @@ -2153,11 +2153,11 @@ void GameView::OnDraw() if(y2>YRES-1) y2 = YRES-1; - ren->BlendFilledRect(RectSized(Vec2{ 0, 0 }, Vec2{ XRES, y1 }), RGBA(0, 0, 0, 100)); - ren->BlendFilledRect(RectSized(Vec2{ 0, y2+1 }, Vec2{ XRES, YRES-y2-1 }), RGBA(0, 0, 0, 100)); + ren->BlendFilledRect(RectSized(Vec2{ 0, 0 }, Vec2{ XRES, y1 }), 0x000000_rgb .WithAlpha(100)); + ren->BlendFilledRect(RectSized(Vec2{ 0, y2+1 }, Vec2{ XRES, YRES-y2-1 }), 0x000000_rgb .WithAlpha(100)); - ren->BlendFilledRect(RectSized(Vec2{ 0, y1 }, Vec2{ x1, (y2-y1)+1 }), RGBA(0, 0, 0, 100)); - ren->BlendFilledRect(RectSized(Vec2{ x2+1, y1 }, Vec2{ XRES-x2-1, (y2-y1)+1 }), RGBA(0, 0, 0, 100)); + ren->BlendFilledRect(RectSized(Vec2{ 0, y1 }, Vec2{ x1, (y2-y1)+1 }), 0x000000_rgb .WithAlpha(100)); + ren->BlendFilledRect(RectSized(Vec2{ x2+1, y1 }, Vec2{ XRES-x2-1, (y2-y1)+1 }), 0x000000_rgb .WithAlpha(100)); ren->XorDottedRect(RectBetween(Vec2{ x1, y1 }, Vec2{ x2, y2 })); } @@ -2198,8 +2198,8 @@ void GameView::OnDraw() break; } startY -= 14; - g->BlendFilledRect(RectSized(Vec2{ startX-3, startY-3 }, Vec2{ Graphics::TextSize(message).X + 5, 14 }), RGBA(0, 0, 0, std::min(100, alpha))); - g->BlendText({ startX, startY }, message, RGBA(255, 255, 255, alpha)); + g->BlendFilledRect(RectSized(Vec2{ startX-3, startY-3 }, Vec2{ Graphics::TextSize(message).X + 5, 14 }), 0x000000_rgb .WithAlpha(std::min(100, alpha))); + g->BlendText({ startX, startY }, message, 0xFFFFFF_rgb .WithAlpha(alpha)); (*iter).second -= 3; } } @@ -2210,8 +2210,8 @@ void GameView::OnDraw() String sampleInfo = String::Build("#", screenshotIndex, " ", String(0xE00E), " REC"); int textWidth = Graphics::TextSize(sampleInfo).X - 1; - g->BlendFilledRect(RectSized(Vec2{ XRES-20-textWidth, 12 }, Vec2{ textWidth+8, 15 }), RGBA(0, 0, 0, 127)); - g->BlendText({ XRES-16-textWidth, 16 }, sampleInfo, RGBA(255, 50, 20, 255)); + g->BlendFilledRect(RectSized(Vec2{ XRES-20-textWidth, 12 }, Vec2{ textWidth+8, 15 }), 0x000000_rgb .WithAlpha(127)); + g->BlendText({ XRES-16-textWidth, 16 }, sampleInfo, 0xFF3214_rgb .WithAlpha(255)); } else if(showHud) { @@ -2331,14 +2331,14 @@ void GameView::OnDraw() } int textWidth = Graphics::TextSize(sampleInfo.Build()).X - 1; - g->BlendFilledRect(RectSized(Vec2{ XRES-20-textWidth, 12 }, Vec2{ textWidth+8, 15 }), RGBA(0, 0, 0, int(alpha*0.5f))); - g->BlendText({ XRES-16-textWidth, 16 }, sampleInfo.Build(), RGBA(255, 255, 255, int(alpha*0.75f))); + g->BlendFilledRect(RectSized(Vec2{ XRES-20-textWidth, 12 }, Vec2{ textWidth+8, 15 }), 0x000000_rgb .WithAlpha(int(alpha*0.5f))); + g->BlendText({ XRES-16-textWidth, 16 }, sampleInfo.Build(), 0xFFFFFF_rgb .WithAlpha(int(alpha*0.75f))); if (wavelengthGfx) { int i, cr, cg, cb, j, h = 3, x = XRES-19-textWidth, y = 10; int tmp; - g->BlendFilledRect(RectSized(Vec2{ x, y }, Vec2{ 30, h }), RGBA(64, 64, 64, alpha)); + g->BlendFilledRect(RectSized(Vec2{ x, y }, Vec2{ 30, h }), 0x404040_rgb .WithAlpha(alpha)); for (i = 0; i < 30; i++) { if ((wavelengthGfx >> i)&1) @@ -2389,8 +2389,8 @@ void GameView::OnDraw() } auto textWidth = Graphics::TextSize(sampleInfo.Build()).X - 1; - g->BlendFilledRect(RectSized(Vec2{ XRES-20-textWidth, 27 }, Vec2{ textWidth+8, 14 }), RGBA(0, 0, 0, int(alpha*0.5f))); - g->BlendText({ XRES-16-textWidth, 30 }, sampleInfo.Build(), RGBA(255, 255, 255, int(alpha*0.75f))); + g->BlendFilledRect(RectSized(Vec2{ XRES-20-textWidth, 27 }, Vec2{ textWidth+8, 14 }), 0x000000_rgb .WithAlpha(int(alpha*0.5f))); + g->BlendText({ XRES-16-textWidth, 30 }, sampleInfo.Build(), 0xFFFFFF_rgb .WithAlpha(int(alpha*0.75f))); } } @@ -2418,35 +2418,35 @@ void GameView::OnDraw() int textWidth = Graphics::TextSize(fpsInfo.Build()).X - 1; int alpha = 255-introText*5; - g->BlendFilledRect(RectSized(Vec2{ 12, 12 }, Vec2{ textWidth+8, 15 }), RGBA(0, 0, 0, int(alpha*0.5))); - g->BlendText({ 16, 16 }, fpsInfo.Build(), RGBA(32, 216, 255, int(alpha*0.75))); + g->BlendFilledRect(RectSized(Vec2{ 12, 12 }, Vec2{ textWidth+8, 15 }), 0x000000_rgb .WithAlpha(int(alpha*0.5))); + g->BlendText({ 16, 16 }, fpsInfo.Build(), 0x20D8FF_rgb .WithAlpha(int(alpha*0.75))); } //Tooltips if(infoTipPresence) { int infoTipAlpha = (infoTipPresence>50?50:infoTipPresence)*5; - g->BlendTextOutline({ (XRES - (Graphics::TextSize(infoTip).X - 1)) / 2, YRES / 2 - 2 }, infoTip, RGBA(255, 255, 255, infoTipAlpha)); + g->BlendTextOutline({ (XRES - (Graphics::TextSize(infoTip).X - 1)) / 2, YRES / 2 - 2 }, infoTip, 0xFFFFFF_rgb .WithAlpha(infoTipAlpha)); } if(toolTipPresence && toolTipPosition.X!=-1 && toolTipPosition.Y!=-1 && toolTip.length()) { if (toolTipPosition.Y == Size.Y-MENUSIZE-10) - g->BlendTextOutline(toolTipPosition, toolTip, RGBA(255, 255, 255, toolTipPresence>51?255:toolTipPresence*5)); + g->BlendTextOutline(toolTipPosition, toolTip, 0xFFFFFF_rgb .WithAlpha(toolTipPresence>51?255:toolTipPresence*5)); else - g->BlendText(toolTipPosition, toolTip, RGBA(255, 255, 255, toolTipPresence>51?255:toolTipPresence*5)); + g->BlendText(toolTipPosition, toolTip, 0xFFFFFF_rgb .WithAlpha(toolTipPresence>51?255:toolTipPresence*5)); } if(buttonTipShow > 0) { - g->BlendText({ 16, Size.Y-MENUSIZE-24 }, buttonTip, RGBA(255, 255, 255, buttonTipShow>51?255:buttonTipShow*5)); + g->BlendText({ 16, Size.Y-MENUSIZE-24 }, buttonTip, 0xFFFFFF_rgb .WithAlpha(buttonTipShow>51?255:buttonTipShow*5)); } //Introduction text if(introText && showHud) { - g->BlendFilledRect(RectSized(Vec2{ 0, 0 }, WINDOW), RGBA(0, 0, 0, introText>51?102:introText*2)); - g->BlendText({ 16, 16 }, introTextMessage, RGBA(255, 255, 255, introText>51?255:introText*5)); + g->BlendFilledRect(RectSized(Vec2{ 0, 0 }, WINDOW), 0x000000_rgb .WithAlpha(introText>51?102:introText*2)); + g->BlendText({ 16, 16 }, introTextMessage, 0xFFFFFF_rgb .WithAlpha(introText>51?255:introText*5)); } } diff --git a/src/gui/game/PropertyTool.cpp b/src/gui/game/PropertyTool.cpp index 1cfe12326..c873dc589 100644 --- a/src/gui/game/PropertyTool.cpp +++ b/src/gui/game/PropertyTool.cpp @@ -239,7 +239,7 @@ void PropertyWindow::OnDraw() Graphics * g = GetGraphics(); g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(200, 200, 200)); + g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb); } void PropertyWindow::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) diff --git a/src/gui/game/SignTool.cpp b/src/gui/game/SignTool.cpp index 2f2087565..88969f017 100644 --- a/src/gui/game/SignTool.cpp +++ b/src/gui/game/SignTool.cpp @@ -169,8 +169,8 @@ void SignWindow::DoDraw() String text = currentSign.getDisplayText(sim, x, y, w, h); g->DrawFilledRect(RectSized(Vec2{ x + 1, y + 1 }, Vec2{ w, h - 1 }), 0x000000_rgb); - g->DrawRect(RectSized(Vec2{ x, y }, Vec2{ w+1, h }), RGB(192, 192, 192)); - g->BlendText({ x+3, y+4 }, text, RGBA(255, 255, 255, 255)); + g->DrawRect(RectSized(Vec2{ x, y }, Vec2{ w+1, h }), 0xC0C0C0_rgb); + g->BlendText({ x+3, y+4 }, text, 0xFFFFFF_rgb .WithAlpha(255)); if (currentSign.ju != sign::None) { @@ -180,7 +180,7 @@ void SignWindow::DoDraw() dy = (currentSign.y > 18) ? -1 : 1; for (int j=0; j<4; j++) { - g->DrawPixel({ x, y }, RGB(192, 192, 192)); + g->DrawPixel({ x, y }, 0xC0C0C0_rgb); x+=dx; y+=dy; } @@ -223,7 +223,7 @@ void SignWindow::OnDraw() Graphics * g = GetGraphics(); g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(200, 200, 200)); + g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb); } std::unique_ptr SignTool::GetIcon(int toolID, Vec2 size) diff --git a/src/gui/game/ToolButton.cpp b/src/gui/game/ToolButton.cpp index 218c7af7b..5fafc498a 100644 --- a/src/gui/game/ToolButton.cpp +++ b/src/gui/game/ToolButton.cpp @@ -76,11 +76,11 @@ void ToolButton::Draw(const ui::Point& screenPos) if (totalColour<544) { - g->BlendText(screenPos + textPosition, buttonDisplayText, RGBA(255, 255, 255, 255)); + g->BlendText(screenPos + textPosition, buttonDisplayText, 0xFFFFFF_rgb .WithAlpha(255)); } else { - g->BlendText(screenPos + textPosition, buttonDisplayText, RGBA(0, 0, 0, 255)); + g->BlendText(screenPos + textPosition, buttonDisplayText, 0x000000_rgb .WithAlpha(255)); } if (ClipRect.Size().X && ClipRect.Size().Y) diff --git a/src/gui/interface/Checkbox.cpp b/src/gui/interface/Checkbox.cpp index 36ff74285..9a423e8e8 100644 --- a/src/gui/interface/Checkbox.cpp +++ b/src/gui/interface/Checkbox.cpp @@ -76,22 +76,22 @@ void Checkbox::Draw(const Point& screenPos) Graphics * g = GetGraphics(); if(checked) { - g->DrawFilledRect(RectSized(screenPos + Vec2{ 5, 5 }, Vec2{ 6, 6 }), RGB(255, 255, 255)); + g->DrawFilledRect(RectSized(screenPos + Vec2{ 5, 5 }, Vec2{ 6, 6 }), 0xFFFFFF_rgb); } if(isMouseOver) { - g->DrawRect(RectSized(screenPos + Vec2{ 2, 2 }, Vec2{ 12, 12 }), RGB(255, 255, 255)); - g->BlendFilledRect(RectSized(screenPos + Vec2{ 5, 5 }, Vec2{ 6, 6 }), RGBA(255, 255, 255, 170)); + g->DrawRect(RectSized(screenPos + Vec2{ 2, 2 }, Vec2{ 12, 12 }), 0xFFFFFF_rgb); + g->BlendFilledRect(RectSized(screenPos + Vec2{ 5, 5 }, Vec2{ 6, 6 }), 0xFFFFFF_rgb .WithAlpha(170)); if (!Appearance.icon) - g->BlendText(screenPos + Vec2{ 18, 4 }, text, RGBA(255, 255, 255, 255)); + g->BlendText(screenPos + Vec2{ 18, 4 }, text, 0xFFFFFF_rgb .WithAlpha(255)); else g->draw_icon(screenPos.X+iconPosition.X, screenPos.Y+iconPosition.Y, Appearance.icon, 255); } else { - g->BlendRect(RectSized(screenPos + Vec2{ 2, 2 }, Vec2{ 12, 12 }), RGBA(255, 255, 255, 200)); + g->BlendRect(RectSized(screenPos + Vec2{ 2, 2 }, Vec2{ 12, 12 }), 0xFFFFFF_rgb .WithAlpha(200)); if (!Appearance.icon) - g->BlendText(screenPos + Vec2{ 18, 4 }, text, RGBA(255, 255, 255, 200)); + g->BlendText(screenPos + Vec2{ 18, 4 }, text, 0xFFFFFF_rgb .WithAlpha(200)); else g->draw_icon(screenPos.X+iconPosition.X, screenPos.Y+iconPosition.Y, Appearance.icon, 200); } diff --git a/src/gui/interface/ContextMenu.cpp b/src/gui/interface/ContextMenu.cpp index 322450424..a1206cb34 100644 --- a/src/gui/interface/ContextMenu.cpp +++ b/src/gui/interface/ContextMenu.cpp @@ -94,6 +94,6 @@ void ContextMenu::AddItem(ContextMenuItem item) void ContextMenu::OnDraw() { Graphics * g = GetGraphics(); - g->DrawFilledRect(RectSized(Position, Size), RGB(100, 100, 100)); + g->DrawFilledRect(RectSized(Position, Size), 0x646464_rgb); g->BlendRect(RectSized(Position, Size), Appearance.BackgroundInactive); } diff --git a/src/gui/interface/DirectionSelector.cpp b/src/gui/interface/DirectionSelector.cpp index 8f35e7ea5..6fc83321b 100644 --- a/src/gui/interface/DirectionSelector.cpp +++ b/src/gui/interface/DirectionSelector.cpp @@ -125,11 +125,11 @@ void DirectionSelector::Draw(const ui::Point& screenPos) center + point.offset - Vec2{ snapPointRadius, snapPointRadius }, center + point.offset + Vec2{ snapPointRadius, snapPointRadius } ), - RGBA(snapPointColor.Red, snapPointColor.Green, snapPointColor.Blue, altDown ? (int)(snapPointColor.Alpha / 2) : snapPointColor.Alpha) + snapPointColor.NoAlpha().WithAlpha(altDown ? (int)(snapPointColor.Alpha / 2) : snapPointColor.Alpha) ); } - g->BlendFilledEllipse(center + value.offset, { handleRadius, handleRadius }, RGBA(foregroundColor.Red, foregroundColor.Green, foregroundColor.Blue, (mouseHover || mouseDown) ? std::min(int(foregroundColor.Alpha * 1.5f), 255) : foregroundColor.Alpha)); + g->BlendFilledEllipse(center + value.offset, { handleRadius, handleRadius }, foregroundColor.NoAlpha().WithAlpha((mouseHover || mouseDown) ? std::min(int(foregroundColor.Alpha * 1.5f), 255) : foregroundColor.Alpha)); g->BlendEllipse(center + value.offset, { handleRadius, handleRadius }, borderColor); } diff --git a/src/gui/interface/Label.cpp b/src/gui/interface/Label.cpp index 234aefefd..b7d767f14 100644 --- a/src/gui/interface/Label.cpp +++ b/src/gui/interface/Label.cpp @@ -253,7 +253,7 @@ void Label::Draw(const Point& screenPos) screenPos + textPosition + Vec2{ selectionXL - 1, selectionYL - 2 }, Vec2{ selectionXH - selectionXL + 1, FONT_H } ), - RGB(255, 255, 255) + 0xFFFFFF_rgb ); } else @@ -263,7 +263,7 @@ void Label::Draw(const Point& screenPos) screenPos + textPosition + Vec2{ selectionXL - 1, selectionYL - 2 }, Vec2{ textSize.X - selectionXL + 1, FONT_H } ), - RGB(255, 255, 255) + 0xFFFFFF_rgb ); for (int i = 1; i < selectionLineH - selectionLineL; ++i) { @@ -272,7 +272,7 @@ void Label::Draw(const Point& screenPos) screenPos + textPosition + Vec2{ -1, selectionYL - 2 + i * FONT_H }, Vec2{ textSize.X + 1, FONT_H } ), - RGB(255, 255, 255) + 0xFFFFFF_rgb ); } g->DrawFilledRect( @@ -280,7 +280,7 @@ void Label::Draw(const Point& screenPos) screenPos + textPosition + Vec2{ -1, selectionYH - 2 }, Vec2{ selectionXH + 1, FONT_H } ), - RGB(255, 255, 255) + 0xFFFFFF_rgb ); } } @@ -288,7 +288,7 @@ void Label::Draw(const Point& screenPos) g->BlendText( screenPos + textPosition, displayTextWithSelection, - RGBA(textColour.Red, textColour.Green, textColour.Blue, 255) + textColour.NoAlpha().WithAlpha(255) ); } diff --git a/src/gui/interface/ProgressBar.cpp b/src/gui/interface/ProgressBar.cpp index 38f077a3e..3f474a9fc 100644 --- a/src/gui/interface/ProgressBar.cpp +++ b/src/gui/interface/ProgressBar.cpp @@ -46,7 +46,7 @@ void ProgressBar::Draw(const Point & screenPos) ui::Colour progressBarColour = style::Colour::WarningTitle; - g->DrawRect(RectSized(Position, Size), RGB(255, 255, 255)); + g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb); if(progress!=-1) { @@ -72,7 +72,7 @@ void ProgressBar::Draw(const Point & screenPos) g->DrawFilledRect(RectSized(screenPos + Vec2{ 2, 2 }, Vec2{ rsize, Size.Y-4 }), progressBarColour.NoAlpha()); } } - g->BlendText(screenPos + Vec2{ ((Size.X-(Graphics::TextSize(progressStatus).X - 1))/2), (Size.Y-8)/2 }, progressStatus, progress<50 ? RGBA(255, 255, 255, 255) : RGBA(0, 0, 0, 255)); + g->BlendText(screenPos + Vec2{ ((Size.X-(Graphics::TextSize(progressStatus).X - 1))/2), (Size.Y-8)/2 }, progressStatus, progress<50 ? 0xFFFFFF_rgb .WithAlpha(255) : 0x000000_rgb .WithAlpha(255)); } void ProgressBar::Tick(float dt) diff --git a/src/gui/interface/RichLabel.cpp b/src/gui/interface/RichLabel.cpp index 22c9e80dc..efa6a7d5f 100644 --- a/src/gui/interface/RichLabel.cpp +++ b/src/gui/interface/RichLabel.cpp @@ -179,7 +179,7 @@ void RichLabel::Draw(const Point& screenPos) { Graphics * g = GetGraphics(); ui::Colour textColour = Appearance.TextInactive; - g->BlendText(screenPos + textPosition, displayText, RGBA(textColour.Red, textColour.Green, textColour.Blue, 255)); + g->BlendText(screenPos + textPosition, displayText, textColour.NoAlpha().WithAlpha(255)); } void RichLabel::OnMouseClick(int x, int y, unsigned button) diff --git a/src/gui/interface/SaveButton.cpp b/src/gui/interface/SaveButton.cpp index 2deb50992..7a5a73150 100644 --- a/src/gui/interface/SaveButton.cpp +++ b/src/gui/interface/SaveButton.cpp @@ -188,7 +188,7 @@ void SaveButton::Draw(const Point& screenPos) if(selected && selectable) { - g->BlendFilledRect(RectSized(screenPos, Size), RGBA(100, 170, 255, 100)); + g->BlendFilledRect(RectSized(screenPos, Size), 0x64AAFF_rgb .WithAlpha(100)); } if (thumbnail) @@ -199,63 +199,63 @@ void SaveButton::Draw(const Point& screenPos) g->BlendImage(tex->Data(), 255, RectSized(screenPos + ((save && save->id) ? ((space - thumbBoxSize) / 2 - Vec2{ 3, 0 }) : (space - thumbSize) / 2), tex->Size())); } else if (file && !file->GetGameSave()) - g->BlendText(screenPos + Vec2{ (Size.X-(Graphics::TextSize("Error loading save").X - 1))/2, (Size.Y-28)/2 }, "Error loading save", RGBA(180, 180, 180, 255)); + g->BlendText(screenPos + Vec2{ (Size.X-(Graphics::TextSize("Error loading save").X - 1))/2, (Size.Y-28)/2 }, "Error loading save", 0xB4B4B4_rgb .WithAlpha(255)); if(save) { if(save->id) { - g->DrawRect(RectSized(screenPos + Vec2{ - 3, 0 } + (Size - thumbBoxSize - Vec2{ 0, 21 }) / 2, thumbBoxSize), isMouseInside ? RGB(210, 230, 255) : RGB(180, 180, 180)); - g->DrawRect(RectSized(screenPos + Vec2{ thumbBoxSize.X - 4, 0 } + (Size - thumbBoxSize - Vec2{ 0, 21 }) / 2, Vec2{ 7, thumbBoxSize.Y }), isMouseInside ? RGB(210, 230, 255) : RGB(180, 180, 180)); + g->DrawRect(RectSized(screenPos + Vec2{ - 3, 0 } + (Size - thumbBoxSize - Vec2{ 0, 21 }) / 2, thumbBoxSize), isMouseInside ? 0xD2E6FF_rgb : 0xB4B4B4_rgb); + g->DrawRect(RectSized(screenPos + Vec2{ thumbBoxSize.X - 4, 0 } + (Size - thumbBoxSize - Vec2{ 0, 21 }) / 2, Vec2{ 7, thumbBoxSize.Y }), isMouseInside ? 0xD2E6FF_rgb : 0xB4B4B4_rgb); - g->DrawFilledRect(RectSized(screenPos + Vec2{ -3+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, 1+(Size.Y-20-thumbBoxSize.Y)/2 }, Vec2{ 5, (thumbBoxSize.Y+1)/2-1 }), RGB(0, 107, 10)); - g->DrawFilledRect(RectSized(screenPos + Vec2{ -3+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, (Size.Y-20)/2 }, Vec2{ 5, thumbBoxSize.Y/2-1 }), RGB(107, 10, 0)); + g->DrawFilledRect(RectSized(screenPos + Vec2{ -3+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, 1+(Size.Y-20-thumbBoxSize.Y)/2 }, Vec2{ 5, (thumbBoxSize.Y+1)/2-1 }), 0x006B0A_rgb); + g->DrawFilledRect(RectSized(screenPos + Vec2{ -3+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, (Size.Y-20)/2 }, Vec2{ 5, thumbBoxSize.Y/2-1 }), 0x6B0A00_rgb); - g->DrawFilledRect(RectSized(screenPos + Vec2{ -2+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, (Size.Y-20)/2-voteBarHeightUp }, Vec2{ 3, voteBarHeightUp }), RGB(57, 187, 57)); //green - g->DrawFilledRect(RectSized(screenPos + Vec2{ -2+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, (Size.Y-20)/2 }, Vec2{ 3, voteBarHeightDown }), RGB(187, 57, 57)); //red + g->DrawFilledRect(RectSized(screenPos + Vec2{ -2+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, (Size.Y-20)/2-voteBarHeightUp }, Vec2{ 3, voteBarHeightUp }), 0x39BB39_rgb); //green + g->DrawFilledRect(RectSized(screenPos + Vec2{ -2+thumbBoxSize.X+(Size.X-thumbBoxSize.X)/2, (Size.Y-20)/2 }, Vec2{ 3, voteBarHeightDown }), 0xBB3939_rgb); //red } else { - g->DrawRect(RectSized(screenPos + (Size - thumbBoxSize - Vec2{ 0, 21 }) / 2, thumbBoxSize), isMouseInside ? RGB(210, 230, 255) : RGB(180, 180, 180)); + g->DrawRect(RectSized(screenPos + (Size - thumbBoxSize - Vec2{ 0, 21 }) / 2, thumbBoxSize), isMouseInside ? 0xD2E6FF_rgb : 0xB4B4B4_rgb); } - g->BlendText(screenPos + Vec2{ (Size.X-(Graphics::TextSize(name).X - 1))/2, Size.Y - 21 }, name, (isMouseInside && !isMouseInsideAuthor) ? RGBA(255, 255, 255, 255) : RGBA(180, 180, 180, 255)); - g->BlendText(screenPos + Vec2{ (Size.X-(Graphics::TextSize(save->userName.FromUtf8()).X - 1))/2, Size.Y - 10 }, save->userName.FromUtf8(), isMouseInsideAuthor ? RGBA(200, 230, 255, 255) : RGBA(100, 130, 160, 255)); + g->BlendText(screenPos + Vec2{ (Size.X-(Graphics::TextSize(name).X - 1))/2, Size.Y - 21 }, name, (isMouseInside && !isMouseInsideAuthor) ? 0xFFFFFF_rgb .WithAlpha(255) : 0xB4B4B4_rgb .WithAlpha(255)); + g->BlendText(screenPos + Vec2{ (Size.X-(Graphics::TextSize(save->userName.FromUtf8()).X - 1))/2, Size.Y - 10 }, save->userName.FromUtf8(), isMouseInsideAuthor ? 0xC8E6FF_rgb .WithAlpha(255) : 0x6482A0_rgb .WithAlpha(255)); if (showVotes)// && !isMouseInside) { int x = screenPos.X-7+(Size.X-thumbBoxSize.X)/2+thumbBoxSize.X-(Graphics::TextSize(votesBackground).X - 1); int y = screenPos.Y-23+(Size.Y-thumbBoxSize.Y)/2+thumbBoxSize.Y; - g->BlendText({ x, y }, votesBackground, RGBA(16, 72, 16, 255)); - g->BlendText({ x, y }, votesBackground2, RGBA(192, 192, 192, 255)); - g->BlendText({ x+3, y }, votesString, RGBA(255, 255, 255, 255)); + g->BlendText({ x, y }, votesBackground, 0x104810_rgb .WithAlpha(255)); + g->BlendText({ x, y }, votesBackground2, 0xC0C0C0_rgb .WithAlpha(255)); + g->BlendText({ x+3, y }, votesString, 0xFFFFFF_rgb .WithAlpha(255)); } if (isMouseInsideHistory && showVotes) { int x = screenPos.X; int y = screenPos.Y-15+(Size.Y-thumbBoxSize.Y)/2+thumbBoxSize.Y; - g->DrawFilledRect(RectSized(Vec2{ x+1, y+1 }, Vec2{ 7, 8 }), RGB(255, 255, 255)); - g->BlendText({ x, y }, 0xE026, isMouseInsideHistory ? RGBA(200, 100, 80, 255) : RGBA(160, 70, 50, 255)); + g->DrawFilledRect(RectSized(Vec2{ x+1, y+1 }, Vec2{ 7, 8 }), 0xFFFFFF_rgb); + g->BlendText({ x, y }, 0xE026, isMouseInsideHistory ? 0xC86450_rgb .WithAlpha(255) : 0xA04632_rgb .WithAlpha(255)); } if (!save->GetPublished()) { - g->BlendText(screenPos - Vec2{ 0, 2 }, 0xE04D, RGBA(255, 255, 255, 255)); - g->BlendText(screenPos - Vec2{ 0, 2 }, 0xE04E, RGBA(212, 151, 81, 255)); + g->BlendText(screenPos - Vec2{ 0, 2 }, 0xE04D, 0xFFFFFF_rgb .WithAlpha(255)); + g->BlendText(screenPos - Vec2{ 0, 2 }, 0xE04E, 0xD49751_rgb .WithAlpha(255)); } } else if (file) { - g->DrawRect(RectSized(screenPos + (Size - thumbBoxSize- Vec2{ 0, 21 }) / 2, thumbBoxSize), isMouseInside ? RGB(210, 230, 255) : RGB(180, 180, 180)); + g->DrawRect(RectSized(screenPos + (Size - thumbBoxSize- Vec2{ 0, 21 }) / 2, thumbBoxSize), isMouseInside ? 0xD2E6FF_rgb : 0xB4B4B4_rgb); if (thumbSize.X) g->XorDottedRect(RectSized(screenPos + (Size - thumbSize - Vec2{ 0, 21 }) / 2, thumbSize)); - g->BlendText(screenPos + Vec2{ (Size.X-(Graphics::TextSize(name).X - 1))/2, Size.Y - 21 }, name, isMouseInside ? RGBA(255, 255, 255, 255) : RGBA(180, 180, 180, 255)); + g->BlendText(screenPos + Vec2{ (Size.X-(Graphics::TextSize(name).X - 1))/2, Size.Y - 21 }, name, isMouseInside ? 0xFFFFFF_rgb .WithAlpha(255) : 0xB4B4B4_rgb .WithAlpha(255)); } if(isMouseInside && selectable) { g->DrawFilledRect(RectSized(screenPos + Vec2{ Size.X - 19, 7 }, Vec2{ 13, 13 }), 0x000000_rgb); - g->DrawRect(RectSized(screenPos + Vec2{ Size.X-20, 6 }, Vec2{ 14, 14 }), RGB(255, 255, 255)); + g->DrawRect(RectSized(screenPos + Vec2{ Size.X-20, 6 }, Vec2{ 14, 14 }), 0xFFFFFF_rgb); if(selected) - g->DrawFilledRect(RectSized(screenPos + Vec2{ Size.X-18, 8 }, Vec2{ 10, 10 }), RGB(255, 255, 255)); + g->DrawFilledRect(RectSized(screenPos + Vec2{ Size.X-18, 8 }, Vec2{ 10, 10 }), 0xFFFFFF_rgb); } } diff --git a/src/gui/interface/ScrollPanel.cpp b/src/gui/interface/ScrollPanel.cpp index 74406ef03..9814d44a8 100644 --- a/src/gui/interface/ScrollPanel.cpp +++ b/src/gui/interface/ScrollPanel.cpp @@ -65,8 +65,8 @@ void ScrollPanel::Draw(const Point& screenPos) scrollPos = float(Size.Y-scrollHeight)*(float(offsetY)/float(maxOffset.Y)); } - g->BlendFilledRect(RectSized(screenPos + Vec2{ Size.X - scrollBarWidth, 0 }, { scrollBarWidth, Size.Y }), RGBA(125, 125, 125, 100)); - g->DrawFilledRect(RectSized(screenPos + Vec2{ Size.X - scrollBarWidth, int(scrollPos) }, { scrollBarWidth, int(scrollHeight)+1 }), RGB(255, 255, 255)); + g->BlendFilledRect(RectSized(screenPos + Vec2{ Size.X - scrollBarWidth, 0 }, { scrollBarWidth, Size.Y }), 0x7D7D7D_rgb .WithAlpha(100)); + g->DrawFilledRect(RectSized(screenPos + Vec2{ Size.X - scrollBarWidth, int(scrollPos) }, { scrollBarWidth, int(scrollHeight)+1 }), 0xFFFFFF_rgb); } } diff --git a/src/gui/interface/Slider.cpp b/src/gui/interface/Slider.cpp index 70fad885a..eac1c9ad8 100644 --- a/src/gui/interface/Slider.cpp +++ b/src/gui/interface/Slider.cpp @@ -116,7 +116,7 @@ void Slider::Draw(const Point& screenPos) } } - g->DrawRect(RectSized(screenPos + Vec2{ 3, 3 }, Size - Vec2{ 6, 6 }), RGB(255, 255, 255)); + g->DrawRect(RectSized(screenPos + Vec2{ 3, 3 }, Size - Vec2{ 6, 6 }), 0xFFFFFF_rgb); auto fPosition = float(sliderPosition); auto fSize = float(Size.X-6); @@ -126,8 +126,8 @@ void Slider::Draw(const Point& screenPos) auto sliderX = int(fSliderX); sliderX += 3; - g->DrawFilledRect(RectSized(screenPos + Vec2{ sliderX-2, 1 }, Vec2{ 4, Size.Y-2 }), RGB(20, 20, 20)); - g->DrawRect(RectSized(screenPos + Vec2{ sliderX-2, 1 }, Vec2{ 4, Size.Y-2 }), RGB(200, 200, 200)); + g->DrawFilledRect(RectSized(screenPos + Vec2{ sliderX-2, 1 }, Vec2{ 4, Size.Y-2 }), 0x141414_rgb); + g->DrawRect(RectSized(screenPos + Vec2{ sliderX-2, 1 }, Vec2{ 4, Size.Y-2 }), 0xC8C8C8_rgb); } } /* namespace ui */ diff --git a/src/gui/interface/Textbox.cpp b/src/gui/interface/Textbox.cpp index 4dc3035cd..1a6f18591 100644 --- a/src/gui/interface/Textbox.cpp +++ b/src/gui/interface/Textbox.cpp @@ -614,20 +614,20 @@ void Textbox::Draw(const Point& screenPos) if(IsFocused()) { if(border) - g->DrawRect(RectSized(Position, Size), RGB(255, 255, 255)); + g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb); g->DrawLine( screenPos + textPosition + Vec2{ cursorPositionX, cursorPositionY-2 }, screenPos + textPosition + Vec2{ cursorPositionX, cursorPositionY+9 }, - RGB(255, 255, 255)); + 0xFFFFFF_rgb); } else { if(!text.length()) { - g->BlendText(screenPos + textPosition, placeHolder, RGBA(textColour.Red, textColour.Green, textColour.Blue, 170)); + g->BlendText(screenPos + textPosition, placeHolder, textColour.NoAlpha().WithAlpha(170)); } if(border) - g->DrawRect(RectSized(Position, Size), RGB(160, 160, 160)); + g->DrawRect(RectSized(Position, Size), 0xA0A0A0_rgb); } if(Appearance.icon) g->draw_icon(screenPos.X+iconPosition.X, screenPos.Y+iconPosition.Y, Appearance.icon); diff --git a/src/gui/login/LoginView.cpp b/src/gui/login/LoginView.cpp index 9d21f7cac..9f8452344 100644 --- a/src/gui/login/LoginView.cpp +++ b/src/gui/login/LoginView.cpp @@ -125,7 +125,7 @@ void LoginView::OnDraw() { Graphics * g = GetGraphics(); g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(255, 255, 255)); + g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb); } LoginView::~LoginView() { diff --git a/src/gui/options/OptionsView.cpp b/src/gui/options/OptionsView.cpp index f9aa08f82..93ccc4f20 100644 --- a/src/gui/options/OptionsView.cpp +++ b/src/gui/options/OptionsView.cpp @@ -46,7 +46,7 @@ OptionsView::OptionsView(): void Draw(const ui::Point& screenPos) override { - GetGraphics()->BlendRect(RectSized(screenPos, Size), RGBA(255, 255, 255, 180)); + GetGraphics()->BlendRect(RectSized(screenPos, Size), 0xFFFFFF_rgb .WithAlpha(180)); } }; @@ -159,7 +159,7 @@ OptionsView::OptionsView(): Graphics * g = GetGraphics(); g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(200, 200, 200)); + g->DrawRect(RectSized(Position, Size), 0xC8C8C8_rgb); } ui::DirectionSelector * gravityDirection; @@ -541,7 +541,7 @@ void OptionsView::OnDraw() { Graphics * g = GetGraphics(); g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(255, 255, 255)); + g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb); } void OptionsView::OnTryExit(ExitMethod method) diff --git a/src/gui/preview/PreviewView.cpp b/src/gui/preview/PreviewView.cpp index b95d29e27..07d606340 100644 --- a/src/gui/preview/PreviewView.cpp +++ b/src/gui/preview/PreviewView.cpp @@ -263,15 +263,15 @@ void PreviewView::DoDraw() g->BlendLine( Position + Vec2{ 1+XRES/2, linePos }, Position + Vec2{ Size.X-2, linePos }, - RGBA(255, 255, 255, 100)); + 0xFFFFFF_rgb .WithAlpha(100)); } if (c->GetDoOpen()) { - g->BlendFilledRect(RectSized(Position + Size / 2 - Vec2{ 101, 26 }, { 202, 52 }), RGBA(0, 0, 0, 210)); - g->BlendRect(RectSized(Position + Size / 2 - Vec2{ 100, 25 }, Vec2{ 200, 50 }), RGBA(255, 255, 255, 180)); - g->BlendText(Position + Vec2{(Size.X/2)-((Graphics::TextSize("Loading save...").X - 1)/2), (Size.Y/2)-5}, "Loading save...", RGBA(style::Colour::InformationTitle.Red, style::Colour::InformationTitle.Green, style::Colour::InformationTitle.Blue, 255)); + g->BlendFilledRect(RectSized(Position + Size / 2 - Vec2{ 101, 26 }, { 202, 52 }), 0x000000_rgb .WithAlpha(210)); + g->BlendRect(RectSized(Position + Size / 2 - Vec2{ 100, 25 }, Vec2{ 200, 50 }), 0xFFFFFF_rgb .WithAlpha(180)); + g->BlendText(Position + Vec2{(Size.X/2)-((Graphics::TextSize("Loading save...").X - 1)/2), (Size.Y/2)-5}, "Loading save...", style::Colour::InformationTitle.NoAlpha().WithAlpha(255)); } - g->DrawRect(RectSized(Position, Size), RGB(255, 255, 255)); + g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb); } @@ -287,8 +287,8 @@ void PreviewView::OnDraw() { g->BlendImage(savePreview->Data(), 0xFF, RectSized(Position + Vec2(1, 1) + (RES / 2 - savePreview->Size()) / 2, savePreview->Size())); } - g->BlendRect(RectSized(Position, RES / 2 + Vec2{ 1, 1 }), RGBA(255, 255, 255, 100)); - g->DrawLine(Position + Vec2{ XRES/2, 1 }, Position + Vec2{ XRES/2, Size.Y-2 }, RGB(200, 200, 200)); + g->BlendRect(RectSized(Position, RES / 2 + Vec2{ 1, 1 }), 0xFFFFFF_rgb .WithAlpha(100)); + g->DrawLine(Position + Vec2{ XRES/2, 1 }, Position + Vec2{ XRES/2, Size.Y-2 }, 0xC8C8C8_rgb); if(votesUp || votesDown) { @@ -312,13 +312,13 @@ void PreviewView::OnDraw() nyu = nyu>50?50:nyu; nyd = nyd>50?50:nyd; - g->DrawFilledRect(RectSized(Position + RES / 2 + Vec2{ -55, 3 }, Vec2{ 53, 7 }), RGB(0, 107, 10)); - g->DrawFilledRect(RectSized(Position + RES / 2 + Vec2{ -55, 9 }, Vec2{ 53, 7 }), RGB(107, 10, 0)); - g->DrawRect(RectSized(Position + Vec2{ (XRES/2)-55, (YRES/2)+3 }, { 53, 7 }), RGB(128, 128, 128)); - g->DrawRect(RectSized(Position + Vec2{ (XRES/2)-55, (YRES/2)+9 }, { 53, 7 }), RGB(128, 128, 128)); + g->DrawFilledRect(RectSized(Position + RES / 2 + Vec2{ -55, 3 }, Vec2{ 53, 7 }), 0x006B0A_rgb); + g->DrawFilledRect(RectSized(Position + RES / 2 + Vec2{ -55, 9 }, Vec2{ 53, 7 }), 0x6B0A00_rgb); + g->DrawRect(RectSized(Position + Vec2{ (XRES/2)-55, (YRES/2)+3 }, { 53, 7 }), 0x808080_rgb); + g->DrawRect(RectSized(Position + Vec2{ (XRES/2)-55, (YRES/2)+9 }, { 53, 7 }), 0x808080_rgb); - g->DrawFilledRect(RectSized(Position + RES / 2 + Vec2{ -4-nyu, 5 }, Vec2{ nyu, 3 }), RGB(57, 187, 57)); - g->DrawFilledRect(RectSized(Position + RES / 2 + Vec2{ -4-nyd, 11 }, Vec2{ nyd, 3 }), RGB(187, 57, 57)); + g->DrawFilledRect(RectSized(Position + RES / 2 + Vec2{ -4-nyu, 5 }, Vec2{ nyu, 3 }), 0x39BB39_rgb); + g->DrawFilledRect(RectSized(Position + RES / 2 + Vec2{ -4-nyd, 11 }, Vec2{ nyd, 3 }), 0xBB3939_rgb); } } diff --git a/src/gui/profile/ProfileActivity.cpp b/src/gui/profile/ProfileActivity.cpp index 5d1f7a8d6..417c05e7d 100644 --- a/src/gui/profile/ProfileActivity.cpp +++ b/src/gui/profile/ProfileActivity.cpp @@ -233,7 +233,7 @@ void ProfileActivity::OnDraw() { Graphics * g = GetGraphics(); g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(255, 255, 255)); + g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb); } void ProfileActivity::OnTryExit(ExitMethod method) diff --git a/src/gui/render/RenderView.cpp b/src/gui/render/RenderView.cpp index 6c92a7d72..63fe35ea3 100644 --- a/src/gui/render/RenderView.cpp +++ b/src/gui/render/RenderView.cpp @@ -162,15 +162,15 @@ void RenderView::OnDraw() ren->RenderBegin(); ren->RenderEnd(); } - g->DrawLine({ 0, YRES }, { XRES-1, YRES }, RGB(200, 200, 200)); - g->DrawLine({ line1, YRES }, { line1, WINDOWH }, RGB(200, 200, 200)); - g->DrawLine({ line2, YRES }, { line2, WINDOWH }, RGB(200, 200, 200)); - g->DrawLine({ line3, YRES }, { line3, WINDOWH }, RGB(200, 200, 200)); - g->DrawLine({ line4, YRES }, { line4, WINDOWH }, RGB(200, 200, 200)); - g->DrawLine({ XRES, 0 }, { XRES, WINDOWH }, RGB(255, 255, 255)); + g->DrawLine({ 0, YRES }, { XRES-1, YRES }, 0xC8C8C8_rgb); + g->DrawLine({ line1, YRES }, { line1, WINDOWH }, 0xC8C8C8_rgb); + g->DrawLine({ line2, YRES }, { line2, WINDOWH }, 0xC8C8C8_rgb); + g->DrawLine({ line3, YRES }, { line3, WINDOWH }, 0xC8C8C8_rgb); + g->DrawLine({ line4, YRES }, { line4, WINDOWH }, 0xC8C8C8_rgb); + g->DrawLine({ XRES, 0 }, { XRES, WINDOWH }, 0xFFFFFF_rgb); if(toolTipPresence && toolTip.length()) { - g->BlendText({ 6, Size.Y-MENUSIZE-12 }, toolTip, RGBA(255, 255, 255, toolTipPresence>51?255:toolTipPresence*5)); + g->BlendText({ 6, Size.Y-MENUSIZE-12 }, toolTip, 0xFFFFFF_rgb .WithAlpha(toolTipPresence>51?255:toolTipPresence*5)); } } diff --git a/src/gui/search/SearchController.cpp b/src/gui/search/SearchController.cpp index b5ce48597..ffb96007a 100644 --- a/src/gui/search/SearchController.cpp +++ b/src/gui/search/SearchController.cpp @@ -206,7 +206,7 @@ void SearchController::OpenSave(int saveID) { delete activePreview; Graphics * g = searchView->GetGraphics(); - g->BlendFilledRect(RectSized(Vec2{ XRES/3, WINDOWH-20 }, Vec2{ XRES/3, 20 }), RGBA(0, 0, 0, 150)); //dim the "Page X of Y" a little to make the CopyTextButton more noticeable + g->BlendFilledRect(RectSized(Vec2{ XRES/3, WINDOWH-20 }, Vec2{ XRES/3, 20 }), 0x000000_rgb .WithAlpha(150)); //dim the "Page X of Y" a little to make the CopyTextButton more noticeable activePreview = new PreviewController(saveID, 0, instantOpen, [this] { OpenSaveDone(); }); activePreview->GetView()->MakeActiveWindow(); } @@ -215,7 +215,7 @@ void SearchController::OpenSave(int saveID, int saveDate) { delete activePreview; Graphics * g = searchView->GetGraphics(); - g->BlendFilledRect(RectSized(Vec2{ XRES/3, WINDOWH-20 }, Vec2{ XRES/3, 20 }), RGBA(0, 0, 0, 150)); //dim the "Page X of Y" a little to make the CopyTextButton more noticeable + g->BlendFilledRect(RectSized(Vec2{ XRES/3, WINDOWH-20 }, Vec2{ XRES/3, 20 }), 0x000000_rgb .WithAlpha(150)); //dim the "Page X of Y" a little to make the CopyTextButton more noticeable activePreview = new PreviewController(saveID, saveDate, instantOpen, [this] { OpenSaveDone(); }); activePreview->GetView()->MakeActiveWindow(); } diff --git a/src/gui/tags/TagsView.cpp b/src/gui/tags/TagsView.cpp index 7b17f391b..a5cae8730 100644 --- a/src/gui/tags/TagsView.cpp +++ b/src/gui/tags/TagsView.cpp @@ -53,7 +53,7 @@ void TagsView::OnDraw() { Graphics * g = GetGraphics(); g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(255, 255, 255)); + g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb); } void TagsView::NotifyTagsChanged(TagsModel * sender) diff --git a/src/lua/LuaWindow.cpp b/src/lua/LuaWindow.cpp index 972e62f5d..5608048d4 100644 --- a/src/lua/LuaWindow.cpp +++ b/src/lua/LuaWindow.cpp @@ -81,7 +81,7 @@ LuaWindow::LuaWindow(lua_State * l) : { Graphics * g = ui::Engine::Ref().g; g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(255, 255, 255)); + g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb); luaWindow->triggerOnDraw(); } void OnInitialized() override { luaWindow->triggerOnInitialized(); } diff --git a/src/tasks/TaskWindow.cpp b/src/tasks/TaskWindow.cpp index 590aca385..448cf309d 100644 --- a/src/tasks/TaskWindow.cpp +++ b/src/tasks/TaskWindow.cpp @@ -87,9 +87,9 @@ void TaskWindow::OnDraw() { Graphics * g = GetGraphics(); g->DrawFilledRect(RectSized(Position - Vec2{ 1, 1 }, Size + Vec2{ 2, 2 }), 0x000000_rgb); - g->DrawRect(RectSized(Position, Size), RGB(255, 255, 255)); + g->DrawRect(RectSized(Position, Size), 0xFFFFFF_rgb); - g->DrawLine(Position + Vec2{ 0, Size.Y-17 }, Position + Vec2{ Size.X - 1, Size.Y-17 }, RGB(255, 255, 255)); + g->DrawLine(Position + Vec2{ 0, Size.Y-17 }, Position + Vec2{ Size.X - 1, Size.Y-17 }, 0xFFFFFF_rgb); ui::Colour progressBarColour = style::Colour::WarningTitle; @@ -117,7 +117,7 @@ void TaskWindow::OnDraw() g->DrawFilledRect(RectSized(Position + Vec2{ 2, Size.Y-15 }, Vec2{ rsize, 13 }), progressBarColour.NoAlpha()); } } - g->BlendText(Position + Vec2{ ((Size.X-(Graphics::TextSize(progressStatus).X - 1))/2), Size.Y-13 }, progressStatus, progress<50 ? RGBA(255, 255, 255, 255) : RGBA(0, 0, 0, 255)); + g->BlendText(Position + Vec2{ ((Size.X-(Graphics::TextSize(progressStatus).X - 1))/2), Size.Y-13 }, progressStatus, progress<50 ? 0xFFFFFF_rgb .WithAlpha(255) : 0x000000_rgb .WithAlpha(255)); } TaskWindow::~TaskWindow() {