public function generateColorCoding($mode, $isFill = false) {

        // initialize the returned code
        $codes = "";

        // ensure the color has a value
        if ($this->isValid()) {
            
            // cast the mode into the class 
            $mode = new Mode($mode);

            // generally you add 10 to escape numbers to switch to fill
            $base = 0;

            // if is fill
            if ($isFill) {

                // use a base of 10
                $base = 10;
            }

            // go through the different terminal modes
            switch ($mode->getMode()) {

                // legacy mode, uses straight-up ansi codes
                case Mode::VT100:

                    // return the coding for old style color (and make it a string like the rest)
                    $codes = ($base + $this->getANSICode()) . "";
                    break;

                
                // Full RGB color, starts with 38;2 for text, or 48;2 for fill followed by R;G;B numbers
                case Mode::RGB:

                    // get the [R,G,B]
                    $RGB = $this->getRGB();

                    // return the full RGB coding
                    $codes  =($base + 38) . ";2;" . $RGB[0] . ";" . $RGB[1] . ";" . $RGB[2];
                    break;

                // Xterm codes, start with 38;5 for text and 48;5 for fill followed by a number from 0-255 for different colors
                case Mode::XTERM:

                    // return the coding for xterm colors
                    $codes = ($base + 38) . ";5;" . $this->getXTermCode();
                    break;

            }
        }

        // return the sequence
        return $codes;

    }