diff options
-rw-r--r-- | Userland/Applets/Audio/main.cpp | 2 | ||||
-rw-r--r-- | Userland/Applets/Keymap/KeymapStatusWindow.cpp | 2 | ||||
-rw-r--r-- | Userland/DevTools/HackStudio/Git/DiffViewer.cpp | 6 | ||||
-rw-r--r-- | Userland/Games/Chess/ChessWidget.h | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibGL/SoftwareGLContext.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/Variant.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibGfx/Bitmap.h | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibGfx/Color.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibGfx/Color.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibGfx/Painter.cpp | 42 | ||||
-rw-r--r-- | Userland/Libraries/LibGfx/Palette.h | 2 |
11 files changed, 38 insertions, 38 deletions
diff --git a/Userland/Applets/Audio/main.cpp b/Userland/Applets/Audio/main.cpp index 383ec6f1f7..ec3f6f77c2 100644 --- a/Userland/Applets/Audio/main.cpp +++ b/Userland/Applets/Audio/main.cpp @@ -169,7 +169,7 @@ private: { GUI::Painter painter(*this); painter.add_clip_rect(event.rect()); - painter.clear_rect(event.rect(), Color::from_rgba(0)); + painter.clear_rect(event.rect(), Color::from_argb(0)); auto& audio_bitmap = choose_bitmap_from_volume(); painter.blit({}, audio_bitmap, audio_bitmap.rect()); diff --git a/Userland/Applets/Keymap/KeymapStatusWindow.cpp b/Userland/Applets/Keymap/KeymapStatusWindow.cpp index 659021c282..95428d2a1c 100644 --- a/Userland/Applets/Keymap/KeymapStatusWindow.cpp +++ b/Userland/Applets/Keymap/KeymapStatusWindow.cpp @@ -43,7 +43,7 @@ void KeymapStatusWindow::wm_event(GUI::WMEvent& event) void KeymapStatusWindow::set_keymap_text(const String& keymap) { GUI::Painter painter(*m_status_widget); - painter.clear_rect(m_status_widget->rect(), Color::from_rgba(0)); + painter.clear_rect(m_status_widget->rect(), Color::from_argb(0)); m_status_widget->set_tooltip(keymap); m_status_widget->set_text(keymap.substring(0, 2)); diff --git a/Userland/DevTools/HackStudio/Git/DiffViewer.cpp b/Userland/DevTools/HackStudio/Git/DiffViewer.cpp index e28f681298..049fbd5978 100644 --- a/Userland/DevTools/HackStudio/Git/DiffViewer.cpp +++ b/Userland/DevTools/HackStudio/Git/DiffViewer.cpp @@ -179,19 +179,19 @@ Vector<String> DiffViewer::split_to_lines(const String& text) Gfx::Color DiffViewer::red_background() { - static Gfx::Color color = Gfx::Color::from_rgba(0x88ff0000); + static Gfx::Color color = Gfx::Color::from_argb(0x88ff0000); return color; } Gfx::Color DiffViewer::green_background() { - static Gfx::Color color = Gfx::Color::from_rgba(0x8800ff00); + static Gfx::Color color = Gfx::Color::from_argb(0x8800ff00); return color; } Gfx::Color DiffViewer::gray_background() { - static Gfx::Color color = Gfx::Color::from_rgba(0x88888888); + static Gfx::Color color = Gfx::Color::from_argb(0x88888888); return color; } diff --git a/Userland/Games/Chess/ChessWidget.h b/Userland/Games/Chess/ChessWidget.h index 251aeed437..a62c00d193 100644 --- a/Userland/Games/Chess/ChessWidget.h +++ b/Userland/Games/Chess/ChessWidget.h @@ -114,10 +114,10 @@ private: BoardMarking m_current_marking; Vector<BoardMarking> m_board_markings; BoardTheme m_board_theme { "Beige", Color::from_rgb(0xb58863), Color::from_rgb(0xf0d9b5) }; - Color m_move_highlight_color { Color::from_rgba(0x66ccee00) }; - Color m_marking_primary_color { Color::from_rgba(0x66ff0000) }; - Color m_marking_alternate_color { Color::from_rgba(0x66ffaa00) }; - Color m_marking_secondary_color { Color::from_rgba(0x6655dd55) }; + Color m_move_highlight_color { Color::from_argb(0x66ccee00) }; + Color m_marking_primary_color { Color::from_argb(0x66ff0000) }; + Color m_marking_alternate_color { Color::from_argb(0x66ffaa00) }; + Color m_marking_secondary_color { Color::from_argb(0x6655dd55) }; Chess::Color m_side { Chess::Color::White }; HashMap<Chess::Piece, RefPtr<Gfx::Bitmap>> m_pieces; String m_piece_set; diff --git a/Userland/Libraries/LibGL/SoftwareGLContext.cpp b/Userland/Libraries/LibGL/SoftwareGLContext.cpp index d544787881..1d63bbc688 100644 --- a/Userland/Libraries/LibGL/SoftwareGLContext.cpp +++ b/Userland/Libraries/LibGL/SoftwareGLContext.cpp @@ -2305,7 +2305,7 @@ void SoftwareGLContext::gl_draw_pixels(GLsizei width, GLsizei height, GLenum for auto pixel_data = static_cast<u32 const*>(data); for (int y = 0; y < height; ++y) for (int x = 0; x < width; ++x) - bitmap->set_pixel(x, y, Color::from_rgba(*(pixel_data++))); + bitmap->set_pixel(x, y, Color::from_argb(*(pixel_data++))); m_rasterizer.blit_to_color_buffer_at_raster_position(bitmap); } else if (format == GL_DEPTH_COMPONENT) { diff --git a/Userland/Libraries/LibGUI/Variant.h b/Userland/Libraries/LibGUI/Variant.h index ccdcd241d5..8862bfa27f 100644 --- a/Userland/Libraries/LibGUI/Variant.h +++ b/Userland/Libraries/LibGUI/Variant.h @@ -235,7 +235,7 @@ public: Color as_color() const { VERIFY(type() == Type::Color); - return Color::from_rgba(m_value.as_color); + return Color::from_argb(m_value.as_color); } const Gfx::Font& as_font() const diff --git a/Userland/Libraries/LibGfx/Bitmap.h b/Userland/Libraries/LibGfx/Bitmap.h index 82d421b477..83cbcd979d 100644 --- a/Userland/Libraries/LibGfx/Bitmap.h +++ b/Userland/Libraries/LibGfx/Bitmap.h @@ -207,7 +207,7 @@ public: [[nodiscard]] static constexpr size_t size_in_bytes(size_t pitch, int physical_height) { return pitch * physical_height; } [[nodiscard]] size_t size_in_bytes() const { return size_in_bytes(m_pitch, physical_height()); } - [[nodiscard]] Color palette_color(u8 index) const { return Color::from_rgba(m_palette[index]); } + [[nodiscard]] Color palette_color(u8 index) const { return Color::from_argb(m_palette[index]); } void set_palette_color(u8 index, Color color) { m_palette[index] = color.value(); } template<StorageFormat> @@ -289,7 +289,7 @@ template<> inline Color Bitmap::get_pixel<StorageFormat::BGRA8888>(int x, int y) const { VERIFY(x >= 0 && x < physical_width()); - return Color::from_rgba(scanline(y)[x]); + return Color::from_argb(scanline(y)[x]); } template<> diff --git a/Userland/Libraries/LibGfx/Color.cpp b/Userland/Libraries/LibGfx/Color.cpp index 65fd3fb557..d0fe3a642b 100644 --- a/Userland/Libraries/LibGfx/Color.cpp +++ b/Userland/Libraries/LibGfx/Color.cpp @@ -245,7 +245,7 @@ Optional<Color> Color::from_string(StringView string) }; if (string.equals_ignoring_case("transparent")) - return Color::from_rgba(0x00000000); + return Color::from_argb(0x00000000); for (size_t i = 0; !web_colors[i].name.is_null(); ++i) { if (string.equals_ignoring_case(web_colors[i].name)) @@ -346,7 +346,7 @@ ErrorOr<void> IPC::decode(IPC::Decoder& decoder, Color& color) { u32 rgba; TRY(decoder.decode(rgba)); - color = Color::from_rgba(rgba); + color = Color::from_argb(rgba); return {}; } diff --git a/Userland/Libraries/LibGfx/Color.h b/Userland/Libraries/LibGfx/Color.h index 3859423c15..42fd140f7a 100644 --- a/Userland/Libraries/LibGfx/Color.h +++ b/Userland/Libraries/LibGfx/Color.h @@ -64,7 +64,7 @@ public: } static constexpr Color from_rgb(unsigned rgb) { return Color(rgb | 0xff000000); } - static constexpr Color from_rgba(unsigned rgba) { return Color(rgba); } + static constexpr Color from_argb(unsigned argb) { return Color(argb); } static constexpr Color from_cmyk(float c, float m, float y, float k) { diff --git a/Userland/Libraries/LibGfx/Painter.cpp b/Userland/Libraries/LibGfx/Painter.cpp index fda618d52e..50df2c9604 100644 --- a/Userland/Libraries/LibGfx/Painter.cpp +++ b/Userland/Libraries/LibGfx/Painter.cpp @@ -54,7 +54,7 @@ ALWAYS_INLINE Color get_pixel(Gfx::Bitmap const& bitmap, int x, int y) if constexpr (format == BitmapFormat::BGRx8888) return Color::from_rgb(bitmap.scanline(y)[x]); if constexpr (format == BitmapFormat::BGRA8888) - return Color::from_rgba(bitmap.scanline(y)[x]); + return Color::from_argb(bitmap.scanline(y)[x]); return bitmap.get_pixel(x, y); } @@ -120,7 +120,7 @@ void Painter::fill_physical_rect(IntRect const& physical_rect, Color color) for (int i = physical_rect.height() - 1; i >= 0; --i) { for (int j = 0; j < physical_rect.width(); ++j) - dst[j] = Color::from_rgba(dst[j]).blend(color).value(); + dst[j] = Color::from_argb(dst[j]).blend(color).value(); dst += dst_skip; } } @@ -421,7 +421,7 @@ void Painter::fill_rounded_corner(IntRect const& a_rect, int radius, Color color for (int i = rect.height() - 1; i >= 0; --i) { for (int j = 0; j < rect.width(); ++j) if (is_in_circle(j, rect.height() - i + clip_offset)) - dst[j] = Color::from_rgba(dst[j]).blend(color).value(); + dst[j] = Color::from_argb(dst[j]).blend(color).value(); dst += dst_skip; } } @@ -462,7 +462,7 @@ void Painter::draw_circle_arc_intersecting(IntRect const& a_rect, IntPoint const for (int i = rect.height() - 1; i >= 0; --i) { for (int j = 0; j < rect.width(); ++j) if (is_on_arc(j, rect.height() - i + clip_offset)) - dst[j] = Color::from_rgba(dst[j]).blend(color).value(); + dst[j] = Color::from_argb(dst[j]).blend(color).value(); dst += dst_skip; } @@ -656,7 +656,7 @@ void Painter::draw_bitmap(IntPoint const& p, GlyphBitmap const& bitmap, Color co for (int row = first_row; row <= last_row; ++row) { for (int j = 0; j <= (last_column - first_column); ++j) { if (bitmap.bit_at(j + first_column, row)) - dst[j] = Color::from_rgba(dst[j]).blend(color).value(); + dst[j] = Color::from_argb(dst[j]).blend(color).value(); } dst += dst_skip; } @@ -667,7 +667,7 @@ void Painter::draw_bitmap(IntPoint const& p, GlyphBitmap const& bitmap, Color co for (int iy = 0; iy < scale; ++iy) for (int ix = 0; ix < scale; ++ix) { auto pixel_index = j * scale + ix + iy * dst_skip; - dst[pixel_index] = Color::from_rgba(dst[pixel_index]).blend(color).value(); + dst[pixel_index] = Color::from_argb(dst[pixel_index]).blend(color).value(); } } } @@ -776,9 +776,9 @@ static void do_blit_with_opacity(BlitState& state) { for (int row = 0; row < state.row_count; ++row) { for (int x = 0; x < state.column_count; ++x) { - Color dest_color = (has_alpha & BlitState::DstAlpha) ? Color::from_rgba(state.dst[x]) : Color::from_rgb(state.dst[x]); + Color dest_color = (has_alpha & BlitState::DstAlpha) ? Color::from_argb(state.dst[x]) : Color::from_rgb(state.dst[x]); if constexpr (has_alpha & BlitState::SrcAlpha) { - Color src_color_with_alpha = Color::from_rgba(state.src[x]); + Color src_color_with_alpha = Color::from_argb(state.src[x]); float pixel_opacity = src_color_with_alpha.alpha() / 255.0; src_color_with_alpha.set_alpha(255 * (state.opacity * pixel_opacity)); state.dst[x] = dest_color.blend(src_color_with_alpha).value(); @@ -871,17 +871,17 @@ void Painter::blit_filtered(IntPoint const& position, Gfx::Bitmap const& source, for (int row = first_row; row <= last_row; ++row) { for (int x = 0; x <= (last_column - first_column); ++x) { - u8 alpha = Color::from_rgba(src[x]).alpha(); + u8 alpha = Color::from_argb(src[x]).alpha(); if (alpha == 0xff) { - auto color = filter(Color::from_rgba(src[x])); + auto color = filter(Color::from_argb(src[x])); if (color.alpha() == 0xff) dst[x] = color.value(); else - dst[x] = Color::from_rgba(dst[x]).blend(color).value(); + dst[x] = Color::from_argb(dst[x]).blend(color).value(); } else if (!alpha) continue; else - dst[x] = Color::from_rgba(dst[x]).blend(filter(Color::from_rgba(src[x]))).value(); + dst[x] = Color::from_argb(dst[x]).blend(filter(Color::from_argb(src[x]))).value(); } dst += dst_skip; src += src_skip; @@ -890,17 +890,17 @@ void Painter::blit_filtered(IntPoint const& position, Gfx::Bitmap const& source, for (int row = first_row; row <= last_row; ++row) { ARGB32 const* src = source.scanline(safe_src_rect.top() + row / s) + safe_src_rect.left() + first_column / s; for (int x = 0; x <= (last_column - first_column); ++x) { - u8 alpha = Color::from_rgba(src[x / s]).alpha(); + u8 alpha = Color::from_argb(src[x / s]).alpha(); if (alpha == 0xff) { - auto color = filter(Color::from_rgba(src[x / s])); + auto color = filter(Color::from_argb(src[x / s])); if (color.alpha() == 0xff) dst[x] = color.value(); else - dst[x] = Color::from_rgba(dst[x]).blend(color).value(); + dst[x] = Color::from_argb(dst[x]).blend(color).value(); } else if (!alpha) continue; else - dst[x] = Color::from_rgba(dst[x]).blend(filter(Color::from_rgba(src[x / s]))).value(); + dst[x] = Color::from_argb(dst[x]).blend(filter(Color::from_argb(src[x / s]))).value(); } dst += dst_skip; } @@ -1680,10 +1680,10 @@ ALWAYS_INLINE void Painter::set_physical_pixel_with_draw_op(u32& pixel, Color co pixel = color.value(); break; case DrawOp::Xor: - pixel = color.xored(Color::from_rgba(pixel)).value(); + pixel = color.xored(Color::from_argb(pixel)).value(); break; case DrawOp::Invert: - pixel = Color::from_rgba(pixel).inverted().value(); + pixel = Color::from_argb(pixel).inverted().value(); break; } } @@ -1701,7 +1701,7 @@ ALWAYS_INLINE void Painter::fill_physical_scanline_with_draw_op(int y, int x, in auto* pixel = m_target->scanline(y) + x; auto* end = pixel + width; while (pixel < end) { - *pixel = Color::from_rgba(*pixel).xored(color).value(); + *pixel = Color::from_argb(*pixel).xored(color).value(); pixel++; } break; @@ -1710,7 +1710,7 @@ ALWAYS_INLINE void Painter::fill_physical_scanline_with_draw_op(int y, int x, in auto* pixel = m_target->scanline(y) + x; auto* end = pixel + width; while (pixel < end) { - *pixel = Color::from_rgba(*pixel).inverted().value(); + *pixel = Color::from_argb(*pixel).inverted().value(); pixel++; } break; @@ -1730,7 +1730,7 @@ void Painter::draw_physical_pixel(IntPoint const& physical_position, Color color if (thickness == 1) { // Implies scale() == 1. auto& pixel = m_target->scanline(physical_position.y())[physical_position.x()]; - return set_physical_pixel_with_draw_op(pixel, Color::from_rgba(pixel).blend(color)); + return set_physical_pixel_with_draw_op(pixel, Color::from_argb(pixel).blend(color)); } IntRect rect { physical_position, { thickness, thickness } }; diff --git a/Userland/Libraries/LibGfx/Palette.h b/Userland/Libraries/LibGfx/Palette.h index 4d0e9096ec..d6d5d9cef3 100644 --- a/Userland/Libraries/LibGfx/Palette.h +++ b/Userland/Libraries/LibGfx/Palette.h @@ -29,7 +29,7 @@ public: Color color(ColorRole role) const { VERIFY((int)role < (int)ColorRole::__Count); - return Color::from_rgba(theme().color[(int)role]); + return Color::from_argb(theme().color[(int)role]); } Gfx::TextAlignment alignment(AlignmentRole role) const |