Overlay Color Element

// Overlay color element.
class RVAPI ColorElem
{
public:
    // Get relolution independent element rectangle using parent rectangle [pRect].
    B2i GetRect(const B2i &pRect) const;

    // Get meta position.
    const MetaPos &GetMetaPos() const;

    // Draw color box. [pRect] is parent rectangle for resolving meta position.
    // [stateColor] is multiplied with text color and can be a literal color or 
    // the state color returned from UI events object.
    void Draw(const B2i &pRect, const Color &stateColor = Color(1, 1, 1)) const;

    // Show/Hide color element.
    void Show(bool show = true);

    // Set color.
    void SetColor(const Color &color);

    // Set meta position.
    void SetMetaPos(const MetaPos &metaPos);

    // Internal.
    void *operator () () const { return (void *)wobj; }

    // Construct color element at [z] order. Higher z overlays lower z.
    ColorElem(uint z);

    // Destructor.
    ~ColorElem();

private:
    byte wobj[96];
};