haiku/headers/private/shared/ColorItem.h
Jessica Hamilton a764093ca8 shared: add ColorItem from Gravity screensaver.
* A useful utility class that will also be used by Terminal later

Change-Id: I23020a401fbab7d4116df31f965ae61ecaf2a6cd
2022-12-22 11:07:28 +13:00

32 lines
670 B
C++

/*
* Copyright 2016-2022 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* John Scipione, jscipione@gmail.com
*
* Based on ColorWhichItem by DarkWyrm (bpmagic@columbus.rr.com)
*/
#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