COLOR command – some observations
Jul 11, 2023 21:20:10 GMT 1
Post by whathim on Jul 11, 2023 21:20:10 GMT 1
I love the vDos COLOR command and am making good use of it - please don’t remove it from future vDos versions. I hope the following observations are of interest/help to other users and trust Jos will correct any misunderstandings I have.
My Open text editor, running in vDos, supports the use of the full palette of 16 colors (the 8 normal colors and the 8 high-intensity colors) for both foreground and background. This is possible because blinking text is disabled (I believe this automatically applies in vDos – please correct me if wrong, Jos).
I’m setting the colors for my editor in a batch file (reproduced below) that I call from Autoexec.txt.
The vDos COLOR command is documented in Readme.pdf as follows:
COLOR Select a theme (T0-9), or set a color attribute, back-, foreground or both to a RGB value. COLOR [T0-9] [h [FG|BG] hhhhhh] (For instance COLOR T3, or COLOR 7 BG a09090).
The syntax I’m interested in for this post is:
COLOR h [FG|BG] hhhhhh
Initially, I had some confusion figuring out what this command was doing. I think the documentation could usefully be expanded:
COLOR h FG hhhhhh - maps color number h, where it’s used as foreground, to RGB value hhhhhh
COLOR h BG hhhhhh - maps color number h, where it’s used as background, to RGB value hhhhhh
COLOR h hhhhhh - maps color number h, where it’s used as foreground or background, to RGB value hhhhhh
The other observations I have are apparent from the comments in the above batch file. Summarizing, they are:
The color number, “h”, is a lowercase hex digit (0,1,2,…f). The COLOR command does not work if an uppercase digit, “B” for example, is used.
The RGB value, “hhhhhh”, is a concatenation of three two-digit hex numbers for the red, green and blue component values. Conversely to the color number, this RGB value can be lowercase or uppercase.
Finally, FWIW, here are screen shots of the color menus from my Open editor before and after applying the above batch file.
My Open text editor, running in vDos, supports the use of the full palette of 16 colors (the 8 normal colors and the 8 high-intensity colors) for both foreground and background. This is possible because blinking text is disabled (I believe this automatically applies in vDos – please correct me if wrong, Jos).
I’m setting the colors for my editor in a batch file (reproduced below) that I call from Autoexec.txt.
@echo off
REM Set Palette colors to RGB values using vDos's COLOR command.
REM
COLOR 0 000000 %= 0,0,0 Black (original is off-black)
COLOR 1 000064 %= 0,0,100 Blue-black
COLOR 2 C8FFC8 %= 200,255,200 Pastel green
COLOR 3 C8FFFF %= 200,255,255 Pastel cyan - Default paper
COLOR 4 FF0000 %= 255,0,0 Red - Error message paper
COLOR 5 FFC8C8 %= 255,200,200 Pastel red
COLOR 6 FFFFC8 %= 255,255,200 Pastel yellow
COLOR a C8FFE6 %= 200,255,230 Pastel cyan-green
COLOR b C8C8FF %= 200,200,255 Pastel blue
COLOR c FFE6C8 %= 255,230,200 Pastel orange
COLOR d FFC8FF %= 255,200,255 Pastel purple
COLOR e E6FFE6 %= 230,255,230 Pastel olive
rem COLOR B C8C8FF %= Doesn't work - color number must be lowercase digit
rem
rem COLOR 02 C8FFC8 %= Doesn't work - color number must be single digit
rem
rem COLOR b c8c8ff %= Works - RGB value can be lowercase or uppercase
The vDos COLOR command is documented in Readme.pdf as follows:
COLOR Select a theme (T0-9), or set a color attribute, back-, foreground or both to a RGB value. COLOR [T0-9] [h [FG|BG] hhhhhh] (For instance COLOR T3, or COLOR 7 BG a09090).
The syntax I’m interested in for this post is:
COLOR h [FG|BG] hhhhhh
Initially, I had some confusion figuring out what this command was doing. I think the documentation could usefully be expanded:
COLOR h FG hhhhhh - maps color number h, where it’s used as foreground, to RGB value hhhhhh
COLOR h BG hhhhhh - maps color number h, where it’s used as background, to RGB value hhhhhh
COLOR h hhhhhh - maps color number h, where it’s used as foreground or background, to RGB value hhhhhh
The other observations I have are apparent from the comments in the above batch file. Summarizing, they are:
The color number, “h”, is a lowercase hex digit (0,1,2,…f). The COLOR command does not work if an uppercase digit, “B” for example, is used.
The RGB value, “hhhhhh”, is a concatenation of three two-digit hex numbers for the red, green and blue component values. Conversely to the color number, this RGB value can be lowercase or uppercase.
Finally, FWIW, here are screen shots of the color menus from my Open editor before and after applying the above batch file.