public function getChartColors(int $count, string $myString, bool $shade = true) : array
    {
        $grad = [];

        // Generate first color
        if ($shade && $count > 0) {
            $color = substr(dechex(crc32($myString)), 0, 6);
            list($r, $g, $b) = array_map(function ($n) {
                return hexdec($n);
            }, str_split($color, 2));

            // Generate second color
            $color2 = substr(dechex(crc32($myString . ' ')), 0, 6);
            list($r2, $g2, $b2) = array_map(function ($n) {
                return hexdec($n);
            }, str_split($color2, 2));

            $rl = ( $r2 - $r) / $count - 1;
            $gl = ( $g2 - $g) / $count - 1;
            $bl = ( $b2 - $b) / $count - 1;

            // Create a shade from the first color to the second
            for ($i = 0; $i < $count; $i++) {
                $grad[] = '#' . str_pad(dechex($r + $rl * $i), 2, "0", 0) . str_pad(dechex($g + $gl * $i), 2, "0", 0) . str_pad(dechex($b + $bl * $i), 2, "0", 0);
            }

            return $grad;
        }

        $my_palette = Configure::read("Widget.colors");

        for ($i = 0; $i < $count; $i++) {
            $grad[] = $my_palette[(crc32($myString) + $i) % count($my_palette)];
        }

        return $grad;
    }