protected function hexToRgb($hex)
    {
        if (! isset($this->colorCache[$hex])) {
            $this->colorCache[$hex] = [
                'r' => hexdec(substr($hex, 0, 2)),
                'g' => hexdec(substr($hex, 2, 2)),
                'b' => hexdec(substr($hex, 4, 2))
            ];
        }

        return $this->colorCache[$hex];
    }