<?php
namespace FacturaScripts\Plugins\ProTheme\Lib\Widget;

use FacturaScripts\Core\Lib\Widget\WidgetColor as ParentWidgetColor;
class WidgetColor extends ParentWidgetColor
{
    public $default;
    public function __construct($data)
    {
        parent::__construct($data);
        $this->default = $data['default'] ?? '';

    }

    protected function setValue($model)
    {
        parent::setValue($model);
        if (empty($this->value)) {
            $this->value = $this->default;
        }
    }
}