src/Util/ColourUtil.php
public static function map256To8(int $colourCode) : string
    {
        if (!isset(self::$coloursMap[$colourCode])) {
            throw new \InvalidArgumentException('Invalid colour code');
        }

        return self::$coloursMap[$colourCode];
    }
public static function map256To8(int $colourCode) : string
    {
        if (!isset(self::$coloursMap[$colourCode])) {
            throw new \InvalidArgumentException('Invalid colour code');
        }

        return self::$coloursMap[$colourCode];
    }
Simple function to transform a 8-bit (256 colours) colour code
to one of the default 8 colors available in the terminal