Charts for colors v1.0a:

BASIC function call:

  change color:

    COLOR <foregound>,<background>

  screen coordinate:

    LOCATE <row>,<column>

  clear screen:

    CLS

Where:

  foreground = 0 to 15
  background = 0 to 7

code   color       code   color
----   -----       ----   -----
  0    Black         8    Gray
  1    Blue          9    Light Blue
  2    Green         10   Light green
  3    Cyan          11   Light cyan
  4    Red           12   Light red
  5    Magenta       13   Light magenta
  6    Brown         14   Yellow
  7    White         15   High-intensity White

ANSI attributes;

ANSI function call;

  (the >[ is escape key ascii 27 plus left bracket);

  change color:

    no reset/no intensity:

      >[<code>;<code>;..m

    reset:

      >[0;<code>;<code>;..m

    hilight:

      >[1;<code>;<code>;..m

  screen coordinate:

    >[<row>;<column>H

  clear screen:

    >[2J

Where:

  code = 

    foreground = 30 to 37   (ISO 6429 standard)
    background = 40 to 47

foreground code  background code
---------------  ---------------
 30 black         40 black
 31 red           41 red
 32 green         42 green
 33 yellow        43 yellow
 34 blue          44 blue
 35 magenta       45 magenta
 36 cyan          46 cyan
 37 white         47 white

Avatar attributes;

Avatar function call;

  change color:

    Chr$(22) + Chr$(1) + Chr$(<code>)

  screen coordinate:

    Chr$(22) + Chr$(8) + Chr$(<row>) + Chr$(<column>)

  clear screen:

    Chr$(12)

Where:

  code = background * 16 + foreground + hilight

    (hilight = 8)

foreground:

byte  color   byte  hi-intensity
----  -----   ----  ------------
 0    black    8     gray
 1    blue     9     light blue
 2    green    10    light green
 3    cyan     11    light cyan
 4    red      12    light red
 5    magenta  13    light magenta
 6    brown    14    yellow
 7    white    15    high-intensity white

background:

byte  color
----  -----
 0    black
 16   blue
 32   green
 48   cyan
 64   red
 80   magenta
 96   yellow
 112  white

for example, white on blue before a cls is avatar code 31.

-end-

Examples to send an color code to the screen:

BASIC CGA function:

   Color 14 ' hi-intensity yellow

ANSI using BIOS function call:

   VarY=33 ' yellow
   Var$=Chr$(27)+"[1;"+Mid$(Str$(VarY),2)+"m" ' hilight color string
   For VarX=1 To Len(Var$) ' send string
      VarY=Asc(Mid$(Var$,VarX,1))
      InregsX.AX=&H0600 ' display function call
      InregsX.DX=VarY
      Call InterruptX(&H21,InregsX,OutregsX)
   Next

Avatar using BIOS function call:

   VarY=14 ' yellow
   Var$=Chr$(22)+Chr$(1)+Chr$(VarY) ' color string
   For VarX=1 To Len(Var$) ' send string
      VarY=Asc(Mid$(Var$,VarX,1))
      InregsX.AX=&H0600 ' display function call
      InregsX.DX=VarY
      Call InterruptX(&H21,InregsX,OutregsX)
   Next

-end-
