Page 1 of 1

RGB colors using VT100 - Win 10 only

Posted: 25 Aug 2017 15:08
by IcarusLives
Hello all ^-^

Still playing with VT100 because honestly it's extremely fun.

Image

After doing some research I found you could use RGB colors as well!

All of the magic happens with this line

Code: Select all

<nul set /p "=ESC[38;2;R;G;Bm TEXT" ESC[0m


Still researching to see if it will do HSL. That would be very cool!

Anyway, I hope you all enjoy!

Code: Select all

@echo off & setlocal enableDelayedExpansion & mode 80,15

for /F %%a in ('echo prompt $E^| cmd') do set "ESC=%%a"

set "s=/\\/\\/\\/\\/\\/\\/\\"

for /l %%a in (0,1,10) do ( for /l %%c in (0,1,77) do (

      set /a "r=255 - (%%c * 255 / 76)", "g=(%%c * 510 / 76)", "b=(%%c * 255 / 76)"
      if !g! gtr 255 set /a "g=510 - g"
      
      <nul set /p "=%ESC%[38;2;!r!;!g!;!b!m!s:~0,1!"%ESC%[0m
      set "s=!s:~1!!s:~3,1!"
   )
   echo.
)

pause & exit

Re: RGB colors using VT100 - Win 10 only

Posted: 25 Aug 2017 15:36
by dbenham
I also did some research into version 10 VT100 sequences.

But I was not aware of the RGB capabilities :!:
Very cool 8)


Dave Benham