shared: add ColorItem from Gravity screensaver.

* A useful utility class that will also be used by Terminal later

Change-Id: I23020a401fbab7d4116df31f965ae61ecaf2a6cd
This commit is contained in:
Jessica Hamilton
2022-12-22 11:07:28 +13:00
parent 9f9688d841
commit a764093ca8
4 changed files with 7 additions and 12 deletions
+31
View File
@@ -0,0 +1,31 @@
/*
* Copyright 2016-2022 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* John Scipione, [email protected]
*
* Based on ColorWhichItem by DarkWyrm ([email protected])
*/
#ifndef _COLOR_ITEM_H
#define _COLOR_ITEM_H
#include <InterfaceDefs.h>
#include <StringItem.h>
class ColorItem : public BStringItem {
public:
ColorItem(const char* string, rgb_color color);
virtual void DrawItem(BView* owner, BRect frame, bool complete);
void SetColor(rgb_color color) { fColor = color; }
rgb_color Color() const { return fColor; }
private:
rgb_color fColor;
};
#endif // _COLOR_ITEM_H