if (in_array($k, $this->_ignore)) {
continue;
}
- $v = $theme->$k;
+ $v = (string)$theme->$k;
if (in_array($k, $this->_colorAlphaFields)) {
$v = self::colorAlphaToWS2($v);
protected static function _colorToWS2($data, $alpha): string
{
$data = trim($data, '# ');
- if (strlen($data) === 6) {
+ if (strlen($data) < 6) {
+ $res = str_repeat('0', 6 - mb_strlen($data)) . $data;
+ } else if (strlen($data) === 6) {
$res = $data;
} else if ($data === 'transparent') {
$res = '00000000';
public static function _colorToWS3($data)
{
if (!isset(self::$_colorToWS3Cache[$data])) {
+ if (strlen($data) < 6) {
+ $data = str_repeat('0', 6 - strlen($data)) . $data;
+ }
if (strlen($data) === 6) {
$res = '#' . $data;
} else if (strlen($data) === 8) {