#pragma once
#include "node.h"
#include "node_color_quad.h"
#include "node_slider.h"

class NodePanelColor : public Node
{
public:
    bool m_interacted = false;
    NodeColorQuad* m_quad;
    NodeSliderHue* m_hue;
    glm::vec4 m_base_color;
    glm::vec4 m_color;
    glm::vec2 m_cursor;
    std::function<void(Node* target, glm::vec4 color)> on_color_changed;
    std::function<void(Node* target)> on_popup_close;
    virtual Node* clone_instantiate() const override;
    virtual void clone_finalize(Node* dest) const override;
    virtual void init() override;
    virtual void added(Node* parent) override;
    virtual kEventResult handle_event(Event* e) override;
    void init_controls();
    void set_color(glm::vec3 rgb);
};
