ColorThief\ColorThief::getHisto PHP Method

getHisto() private static method

Histo: 1-d array, giving the number of pixels in each quantized region of color space
private static getHisto ( array $pixels ) : array
$pixels array
return array
    private static function getHisto($pixels)
    {
        $histo = array();
        foreach ($pixels as $rgb) {
            list($red, $green, $blue) = static::getColorsFromIndex($rgb);
            $index = static::getColorIndex($red, $green, $blue);
            $histo[$index] = (isset($histo[$index]) ? $histo[$index] : 0) + 1;
        }
        return $histo;
    }