0 ? (int) $val : 0; }, $hex); $dhex = array_map('hexdec', $hex); if (array_fill(0, 3, $dhex[0]) === $dhex && (int) substr($dhex[0], -1) === 8) { $x11 = 232 + (int) floor($dhex[0]/10); return new static($x11); } $x11 = $ahex[0] * 36 + $ahex[1] * 6 + $ahex[2] + 16; return new static($x11); } }