public static function color($fgcolor, $style, $bgcolor)
    {
        $code = array();
        if ($fgcolor == 'reset') {
            return "\033[0m";
        }
        if (isset(static::$FGCOLOR[$fgcolor])) {
            $code[] = static::$FGCOLOR[$fgcolor];
        }
        if (isset(static::$STYLE[$style])) {
            $code[] = static::$STYLE[$style];
        }
        if (isset(static::$BGCOLOR[$bgcolor])) {
            $code[] = static::$BGCOLOR[$bgcolor];
        }
        if (empty($code)) {
            $code[] = 0;
        }
        return "\033[" . implode(';', $code) . 'm';
    }
public static function color($fgcolor, $style, $bgcolor)
    {
        $code = array();
        if ($fgcolor == 'reset') {
            return "\033[0m";
        }
        if (isset(static::$FGCOLOR[$fgcolor])) {
            $code[] = static::$FGCOLOR[$fgcolor];
        }
        if (isset(static::$STYLE[$style])) {
            $code[] = static::$STYLE[$style];
        }
        if (isset(static::$BGCOLOR[$bgcolor])) {
            $code[] = static::$BGCOLOR[$bgcolor];
        }
        if (empty($code)) {
            $code[] = 0;
        }
        return "\033[" . implode(';', $code) . 'm';
    }
public static function color ( $ fgcolor , $ style , $ bgcolor ) { $ code = array ( ) ; if ( $ fgcolor == 'reset' ) { return "\033[0m" ; } if ( isset ( static :: $ FGCOLOR [ $ fgcolor ] ) ) { $ code [ ] = static :: $ FGCOLOR [ $ fgcolor ] ; } if ( isset ( static :: $ STYLE [ $ style ] ) ) { $ code [ ] = static :: $ STYLE [ $ style ] ; } if ( isset ( static :: $ BGCOLOR [ $ bgcolor ] ) ) { $ code [ ] = static :: $ BGCOLOR [ $ bgcolor ] ; } if ( empty ( $ code ) ) { $ code [ ] = 0 ; } return "\033[" . implode ( ';' , $ code ) . 'm' ; }
Create ANSI-control codes for text foreground and background colors, and
styling.

@param string $fgcolor Text foreground color
@param string $style   Text style
@param string $bgcolor Text background color

@return string ANSI-control code
Create ANSI - control codes for text foreground and background colors and styling .