1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:37:43 +00:00

PaintBrush: Add a color picker tool.

This commit is contained in:
Andreas Kling 2019-06-22 12:05:35 +02:00
parent 41613e4303
commit 25fd847ef2
8 changed files with 71 additions and 2 deletions

View file

@ -15,8 +15,8 @@ public:
Color primary_color() const { return m_primary_color; }
Color secondary_color() const { return m_secondary_color; }
void set_primary_color(Color color) { m_primary_color = color; }
void set_secondary_color(Color color) { m_secondary_color = color; }
void set_primary_color(Color);
void set_secondary_color(Color);
void set_tool(Tool* tool);
Tool* tool();
@ -26,6 +26,9 @@ public:
GraphicsBitmap& bitmap() { return *m_bitmap; }
const GraphicsBitmap& bitmap() const { return *m_bitmap; }
Function<void(Color)> on_primary_color_change;
Function<void(Color)> on_secondary_color_change;
private:
virtual void paint_event(GPaintEvent&) override;
virtual void mousedown_event(GMouseEvent&) override;