#include <Widget/ColorIndicator/ColorIndicator.hpp>

ColorIndicator::ColorIndicator(Material &baseImage, const RGBABytes &color) :
    baseImage(baseImage),
    color(color)
{}

void ColorIndicator::draw(GraphicsContext &context)
{
    context.color = glm::vec4(
        color.channels[0] / 255.0f,
        color.channels[1] / 255.0f,
        color.channels[2] / 255.0f,
        color.alpha / 255.0f
    );

    context.drawMaterial(baseImage, 0, 0);
}

glm::ivec2 ColorIndicator::getMinSize()
{
    return glm::ivec2(baseImage.width(), baseImage.height());
}