<?php

namespace Plainwork\Ui\Renderer\Form;

use Plainwork\Http\Request;
use Plainwork\Ui\Component\Form\ColorInput;

final class ColorInputRenderer
{
    public function __invoke(ColorInput $el, Request $request, callable $next)
    {
        $el = $el
            ->withTag('input')
            ->withAttr('type', 'color')
            ->withAttr('value', $el->getValue())
            ;

        return $next($el, $request);
    }
}
