1/* 2 * Copyright 2006, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 */ 8 9#ifndef COLOR_PROPERTY_H 10#define COLOR_PROPERTY_H 11 12#include <GraphicsDefs.h> 13 14#include "Property.h" 15 16class ColorProperty : public Property { 17 public: 18 ColorProperty(uint32 identifier); 19 ColorProperty(uint32 identifier, 20 rgb_color color); 21 ColorProperty(const ColorProperty& other); 22 ColorProperty(BMessage* archive); 23 24 virtual ~ColorProperty(); 25 26 virtual status_t Archive(BMessage* archive, 27 bool deep = true) const; 28 static BArchivable* Instantiate(BMessage* archive); 29 30 virtual Property* Clone() const; 31 32 virtual type_code Type() const 33 { return B_RGB_COLOR_TYPE; } 34 35 virtual bool SetValue(const char* value); 36 virtual bool SetValue(const Property* other); 37 virtual void GetValue(BString& string); 38 39 virtual bool InterpolateTo(const Property* other, 40 float scale); 41 42 // ColorProperty 43 bool SetValue(rgb_color color); 44 rgb_color Value() const; 45 46 private: 47 rgb_color fValue; 48}; 49 50 51#endif // COLOR_PROPERTY_H 52 53 54