umouse

umouse.git
git clone git://git.lenczewski.org/umouse.git
Log | Files | Refs | Submodules | README

VT100COLOURS.fth (929B)


      1 \ VT100 attributes
      2 27 CONSTANT ESC
      3 : <##>    ( n -- ) \ sends n, radix 10, no spaces
      4           BASE @ >R DECIMAL 0 <# #S #> TYPE   R> BASE ! ;
      5 : ESC[   ( -- )
      6 	ESC EMIT ." [" ;
      7 \ Attributes
      8 0 CONSTANT DEFAULT	\ All attributes off 
      9 1 CONSTANT BOLD		\ Increased intensity
     10 2 CONSTANT DIM		\ Decreased intensity
     11 3 CONSTANT ITALIC	\ If supported by terminal
     12 4 CONSTANT UNDERLINE	\ If supported by terminal
     13 5 CONSTANT BLINK	\ Slow blink
     14 7 CONSTANT REV		\ Reverse video
     15 8 CONSTANT BLANK	\ If supported by terminal
     16 \ Colours
     17 0 CONSTANT BLACK
     18 1 CONSTANT RED
     19 2 CONSTANT GREEN
     20 3 CONSTANT YELLOW
     21 4 CONSTANT BLUE
     22 5 CONSTANT MAGENTA
     23 6 CONSTANT CYAN
     24 7 CONSTANT WHITE
     25 : ATTR   ( a -- ) 	\ Attribute 0-8
     26 	ESC[ <##> ." m" ;
     27 : TEXT       ( c -- )	\ Text colour
     28 	30 + ATTR ;
     29 : BACKGROUND ( c -- )	\ Background colour
     30 	40 + ATTR ;	
     31 \ Examples of use:
     32 \ WHITE TEXT BLUE BACKGROUND 
     33 \ BLUE TEXT  BOLD ATTR
     34 \ CYAN TEXT