src/Pin/Color.php
public static function foreground($color)
    {
        list($red, $green, $blue) = str_split(substr($color, 1), 2);

        $red   = hexdec($red);
        $green = hexdec($green);
        $blue  = hexdec($blue);

        return ($red < 200 && $green < 100 && $blue < 200) ? self::WHITE : self::BLACK;
    }
public static function foreground($color)
    {
        list($red, $green, $blue) = str_split(substr($color, 1), 2);

        $red   = hexdec($red);
        $green = hexdec($green);
        $blue  = hexdec($blue);

        return ($red < 200 && $green < 100 && $blue < 200) ? self::WHITE : self::BLACK;
    }
public static function foreground ( $ color ) { list ( $ red , $ green , $ blue ) = str_split ( substr ( $ color , 1 ) , 2 ) ; $ red = hexdec ( $ red ) ; $ green = hexdec ( $ green ) ; $ blue = hexdec ( $ blue ) ; return ( $ red < 200 && $ green < 100 && $ blue < 200 ) ? self :: WHITE : self :: BLACK ; }
Returns a colour string for use as a foreground colour with the specified background colour.

@param string $color

@return string
Returns a colour string for use as a foreground colour with the specified background colour .