1 #ifndef _RIVE_SOLID_COLOR_BASE_HPP_
2 #define _RIVE_SOLID_COLOR_BASE_HPP_
3 #include "component.hpp"
4 #include "core/field_types/core_color_type.hpp"
7 class SolidColorBase : public Component
10 typedef Component Super;
13 static const uint16_t typeKey = 18;
15 /// Helper to quickly determine if a core object extends another without
17 bool isTypeOf(uint16_t typeKey) const override
21 case SolidColorBase::typeKey:
22 case ComponentBase::typeKey:
29 uint16_t coreType() const override { return typeKey; }
31 static const uint16_t colorValuePropertyKey = 37;
34 int m_ColorValue = 0xFF747474;
36 inline int colorValue() const { return m_ColorValue; }
37 void colorValue(int value)
39 if (m_ColorValue == value)
47 Core* clone() const override;
48 void copy(const SolidColorBase& object)
50 m_ColorValue = object.m_ColorValue;
51 Component::copy(object);
54 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
58 case colorValuePropertyKey:
59 m_ColorValue = CoreColorType::deserialize(reader);
62 return Component::deserialize(propertyKey, reader);
66 virtual void colorValueChanged() {}