src/Mixer.php
public function mix() : Color
    {
        foreach ($this->colors as $color) {
            $colors  = $color->dec();
            $reds  []= $colors[0];
            $greens[]= $colors[1];
            $blues []= $colors[2];
        }

        $red   = dechex( round(array_sum($reds)  / count($reds)  ) );
        $green = dechex( round(array_sum($greens)/ count($greens)) );
        $blue  = dechex( round(array_sum($blues) / count($blues) ) );

        // pad single-digit hexadecimals with leading zero
        foreach ([&$red, &$green, &$blue] as &$color) {
            if (strlen($color) === 1) {
                $color = "0$color";
            }
        }

        return new Color($red.$green.$blue);
    }
public function mix() : Color
    {
        foreach ($this->colors as $color) {
            $colors  = $color->dec();
            $reds  []= $colors[0];
            $greens[]= $colors[1];
            $blues []= $colors[2];
        }

        $red   = dechex( round(array_sum($reds)  / count($reds)  ) );
        $green = dechex( round(array_sum($greens)/ count($greens)) );
        $blue  = dechex( round(array_sum($blues) / count($blues) ) );

        // pad single-digit hexadecimals with leading zero
        foreach ([&$red, &$green, &$blue] as &$color) {
            if (strlen($color) === 1) {
                $color = "0$color";
            }
        }

        return new Color($red.$green.$blue);
    }
public function mix ( ) : Color { foreach ( $ this -> colors as $ color ) { $ colors = $ color -> dec ( ) ; $ reds [ ] = $ colors [ 0 ] ; $ greens [ ] = $ colors [ 1 ] ; $ blues [ ] = $ colors [ 2 ] ; } $ red = dechex ( round ( array_sum ( $ reds ) / count ( $ reds ) ) ) ; $ green = dechex ( round ( array_sum ( $ greens ) / count ( $ greens ) ) ) ; $ blue = dechex ( round ( array_sum ( $ blues ) / count ( $ blues ) ) ) ; // pad single-digit hexadecimals with leading zero foreach ( [ & $ red , & $ green , & $ blue ] as & $ color ) { if ( strlen ( $ color ) === 1 ) { $ color = "0$color" ; } } return new Color ( $ red . $ green . $ blue ) ; }
Get the mixed color.

@return Color Returns a new Color object from the Mixer.
Get the mixed color .