#include "node.h"
#include "node_border.h"
#include "node_slider.h"
#include "node_colorwheel.h"
#include "node_button.h"

class NodeColorPicker : public NodeBorder
{
public:
    NodeSliderH* m_slider_h;
    NodeSliderH* m_slider_s;
    NodeSliderH* m_slider_v;
    NodeSliderH* m_slider_r;
    NodeSliderH* m_slider_g;
    NodeSliderH* m_slider_b;
    NodeColorWheel* m_wheel;
    NodeBorder* m_color_cur;
    NodeBorder* m_color_old;
    NodeBorder* m_color_old1;
    NodeBorder* m_color_old2;
    NodeButton* m_button_select;
    glm::vec3 m_rgb;
    glm::vec3 m_hsv;

    virtual Node* clone_instantiate() const override;
    //virtual void clone_copy(Node* dest) const override;
    virtual void clone_finalize(Node* dest) const override;
    virtual void init() override;
    virtual void draw() override;
    void init_controls();
    glm::vec3 get_hsv() const;
    void handle_value_changed();
};
