Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return a formatted string
sprintf(string $formatmixed ...$values): string
        $setCodes   implode(';'collection($this->parseColor($color))->toArray());

        
$unsetCodes implode(';'collection(['39'])->toArray());



        return 
sprintf(terminal()->getCsi() . '%sm'$setCodes) . $value sprintf(terminal()->getCsi() . '%sm'$unsetCodes);

    }
        $setCodes   implode(';'collection($this->parseColor($colortrue))->toArray());

        
$unsetCodes implode(';'collection(['49'])->toArray());



        return 
sprintf(terminal()->getCsi() . '%sm'$setCodes) . $value sprintf(terminal()->getCsi() . '%sm'$unsetCodes);

    }
    public function getRandomHexColor(): string

    
{

        return 
sprintf('#%06X'mt_rand(00xFFFFFF));

    }
    public function convertRgbColorToHex(string $color): string

    
{

        if (
preg_match('/(\d{1,3})\,?\s?(\d{1,3})\,?\s?(\d{1,3})/'$color$matches)) {

            
$color sprintf('%02x%02x%02x'$matches[1], $matches[2], $matches[3]);

        }



        return 
$color;
            }



            if (
strings($color)->length() !== 6) {

                throw new 
InvalidArgumentException(sprintf('Invalid "%s" color.'$color));

            }



            return (
$background '4' '3') . $this->convertHexColorToAnsi(hexdec($color));
            return ($background '10' '9') . self::BRIGHT_COLORS[$color];

        }



        throw new 
InvalidArgumentException(sprintf('Invalid "%s" color; expected one of (%s).'$colorimplode(', 'array_merge(array_keys(self::COLORS), array_keys(self::BRIGHT_COLORS)))));

    }
            return (string) $this->degradeHexColorToAnsi($r$g$b);

        }



        return 
sprintf('8;2;%d;%d;%d'$r$g$b);

    }
        $code trim(fread($input1024));



        
shell_exec(sprintf('stty %s'$sttyMode));



        
sscanf($codeterminal()->getCsi() . '%d;%dR'$row$col);
            return $this->h(strings($method)->substr(1)->toInteger());

        }



        throw new 
BadMethodCallException(sprintf(

            
'Method %s::%s does not exist.',

            static::class,

            
$method

        
));

    }