private function generateColoursSetCode() : void
    {
        if (!ctype_digit($this->fg)) {
            $fgCode = self::$availableForegroundColors[$this->fg];
        } else {
            $fgCode = sprintf("38;5;%s", $this->fg);
        }

        if (!ctype_digit($this->bg)) {
            $bgCode = self::$availableBackgroundColors[$this->bg];
        } else {
            $bgCode = sprintf("48;5;%s", $this->bg);
        }

        $this->coloursSetCode = sprintf("\033[%s;%sm", $fgCode, $bgCode);
    }
private function generateColoursSetCode() : void
    {
        if (!ctype_digit($this->fg)) {
            $fgCode = self::$availableForegroundColors[$this->fg];
        } else {
            $fgCode = sprintf("38;5;%s", $this->fg);
        }

        if (!ctype_digit($this->bg)) {
            $bgCode = self::$availableBackgroundColors[$this->bg];
        } else {
            $bgCode = sprintf("48;5;%s", $this->bg);
        }

        $this->coloursSetCode = sprintf("\033[%s;%sm", $fgCode, $bgCode);
    }
private function generateColoursSetCode ( ) : void { if ( ! ctype_digit ( $ this -> fg ) ) { $ fgCode = self :: $ availableForegroundColors [ $ this -> fg ] ; } else { $ fgCode = sprintf ( "38;5;%s" , $ this -> fg ) ; } if ( ! ctype_digit ( $ this -> bg ) ) { $ bgCode = self :: $ availableBackgroundColors [ $ this -> bg ] ; } else { $ bgCode = sprintf ( "48;5;%s" , $ this -> bg ) ; } $ this -> coloursSetCode = sprintf ( "\033[%s;%sm" , $ fgCode , $ bgCode ) ; }
Generates the ansi escape sequence to set the colours
Generates the ansi escape sequence to set the colours