Special Console Output Characters

Prev Next

Introduction

B4P is also supporting a set of dedicated UNICODE characters for formatting text contents before outputting the with standard functions such as echo(), format print() and print(). Typical examples are changing text and background color, enabling underscore and some cursor navigation symbols.

These characters ensure cross-platform compatibility.
See Special console output characters.

Note: You may have considered Escape sequences (which date back to Digital Equipment VT100 terminals in the late 1970's , e.g. ESC [A for cursor movements) but these symbols do typically contain multiple characters and B4P will not guarantee cross platform portability.

Tab Features

The tab character( B4P: reserved keyword tab ) provides fixed tab positions in steps of eight characters. In addition to this, B4P provides a set of reserved characters and entitites to advance to a specific position.

This feature is also suitable for batch or redirected output because it converts these characters variable number of spaces.

Functionality UNICODE (hex) Character Entity Name
Tab position 1 103001 &tab1;
Tab position 2 103002 &tab2;
... ... ...
Tab position 300 10312c &tab300;

Formatting Features

Some functions, especially blinking text, are not supported on all terminals.

Functionality UNICODE (hex) Character Entity Name
Reset console 100000 &reset;
Underscore toggle/off/on 100010-100012 &underscore; &underscore off; &underscore on;
Boldface toggle/off/on 100014-100016 &boldface; &boldface off; &boldface on;
Blinking toggle/off/on 100018-10001a &blinking; &blinking off; &blinking on;
Reverse toggle/off/on 10001c-10001e &reverse; &reverse off; &reverse on;

Console Colors

Following text and background colors are supported on the console: Inside the entities, color names in lower-case letters refer to text color, and color names in upper-case letters refer to background color. The color names on the left hand column are also valid names for the functions text color() and background color().

Color name UNICODE (hex) Character Entity Names RBG Color Code
previous 101120, 102120 &previous; &PREVIOUS; Previous color
default 101121, 102121 &default; &DEFAULT; Default console color
black 101000, 102000 &black; &BLACK; 0, 0, 0
very dark gray 101001, 102001 &very dark gray; &VERY DARK GRAY; 64, 64, 64
dark gray 101002, 102002 &dark gray; &DARK GRAY; 85, 85, 85
gray 101003, 102003 &gray; &GRAY; 128, 128, 128
light gray 101004, 102004 &light gray; &LIGHT GRAY; 192, 192, 192
very light gray 101005, 102005 &very light gray; &VERY LIGHT GRAY; 224, 224, 224
white 101006, 102006 &white; &WHITE; 255, 255, 255
dark red 101010, 102010 &dark red; &DARK RED; 170, 0, 0
red 101011, 102011 &red; &RED; 255, 0, 0
light red 101012, 102012 &light red; &LIGHT RED; 255, 128, 128
dark scarlet 101014, 102014 &dark scarlet; &DARK SCARLET; 170, 43, 0
scarlet 101015, 102015 &scarlet; &SCARLET; 255, 64, 0
light scarlet 101016, 102016 &light scarlet; &LIGHT SCARLET; 255, 160, 128
dark mandarin 101018, 102018 &dark mandarin; &DARK MANDARIN; 170, 86, 0
mandarin 101019, 102019 &mandarin; &MANDARIN; 255, 128, 0
light mandarin 10101a, 10201a &light mandarin; &LIGHT MANDARIN; 255, 192, 128
dark orange 10101c, 10201c &dark orange; &DARK ORANGE; 170, 128, 0
orange 10101d, 10201d &orange; &ORANGE; 255, 192, 0
light orange 10101e, 10201e &light orange; &LIGHT ORANGE; 255, 224, 128
dark mango 101020, 102020 &dark mango; &DARK MANGO; 170, 150, 0
mango 101021, 102021 &mango; &MANGO; 255, 224, 0
light mango 101022, 102022 &light mango; &LIGHT MANGO; 255, 240, 128
dark chrome 101024, 102024 &dark chrome; &DARK CHROME; 170, 160, 0
chrome 101025, 102025 &chrome; &CHROME; 255, 240, 0
light chrome 101026, 102026 &light chrome; &LIGHT CHROME; 255, 248, 128
dark yellow 101028, 102028 &dark yellow; &DARK YELLOW; 170, 170, 0
yellow 101029, 102029 &yellow; &YELLOW; 255, 255, 0
light yellow 10102a, 10202a &light yellow; &LIGHT YELLOW; 255, 255, 128
dark lemon 10102c, 10202c &dark lemon; &DARK LEMON; 150, 170, 0
lemon 10102d, 10202d &lemon; &LEMON; 224, 255, 0
light lemon 10102e, 10202e &light lemon; &LIGHT LEMON; 240, 255, 128
dark granny 101030, 102030 &dark granny; &DARK GRANNY; 127, 170, 0
granny 101031, 102031 &granny; &GRANNY; 192, 255, 0
light granny 101032, 102032 &light granny; &LIGHT GRANNY; 224, 255, 128
dark chartreuse 101034, 102034 &dark chartreuse; &DARK CHARTREUSE; 86, 170, 0
chartreuse 101035, 102035 &chartreuse; &CHARTREUSE; 128, 255, 0
light chartreuse 101036, 102036 &light chartreuse; &LIGHT CHARTREUSE; 192, 255, 128
dark green 101038, 102038 &dark green; &DARK GREEN; 0, 170, 0
green 101039, 102039 &green; &GREEN; 0, 255, 0
light green 10103a, 10203a &light green; &LIGHT GREEN; 128, 255, 128
dark spring green 10103c, 10203c &dark spring green; &DARK SPRING GREEN; 0, 170, 86
spring green 10103d, 10203d &spring green; &SPRING GREEN; 0, 255, 128
light spring green 10103e, 10203e &light spring green; &LIGHT SPRING GREEN; 128, 255, 192
dark turquoise 101040, 102040 &dark turquoise; &DARK TURQUOISE; 0, 170, 128
turquoise 101041, 102041 &turquoise; &TURQUOISE; 0, 255, 192
light turquoise 101042, 102042 &light turquoise; &LIGHT TURQUOISE; 128, 255, 224
dark cyan 101044, 102044 &dark cyan; &DARK CYAN; 0, 170, 170
cyan 101045, 102045 &cyan; &CYAN; 0, 255, 255
light cyan 101046, 102046 &light cyan; &LIGHT CYAN; 128, 255, 255
dark sky blue 101048, 102048 &dark sky blue; &DARK SKY BLUE; 0, 150, 170
sky blue 101049, 102049 &sky blue; &SKY BLUE; 0, 224, 255
light sky blue 10104a, 10204a &light sky blue; &LIGHT SKY BLUE; 128, 241, 255
dark aquamarine 10104c, 10204c &dark aquamarine; &DARK AQUAMARINE; 0, 128, 170
aquamarine 10104d, 10204d &aquamarine; &AQUAMARINE; 0, 192, 255
light aquamarine 10104e, 10204e &light aquamarine; &LIGHT AQUAMARINE; 128, 224, 255
dark azur 101050, 102050 &dark azur; &DARK AZUR; 0, 107, 170
azur 101051, 102051 &azur; &AZUR; 0, 160, 255
light azur 101052, 102052 &light azur; &LIGHT AZUR; 128, 208, 255
dark ocean 101054, 102054 &dark ocean; &DARK OCEAN; 0, 86, 170
ocean 101055, 102055 &ocean; &OCEAN; 0, 128, 255
light ocean 101056, 102056 &light ocean; &LIGHT OCEAN; 128, 192, 255
dark sapphire 101058, 102058 &dark sapphire; &DARK SAPPHIRE; 0, 64, 170
sapphire 101059, 102059 &sapphire; &SAPPHIRE; 0, 96, 255
light sapphire 10105a, 10205a &light sapphire; &LIGHT SAPPHIRE; 128, 176, 255
dark lapis 10105c, 10205c &dark lapis; &DARK LAPIS; 0, 43, 170
lapis 10105d, 10205d &lapis; &LAPIS; 0, 64, 255
light lapis 10105e, 10205e &light lapis; &LIGHT LAPIS; 128, 160, 255
dark royal blue 101060, 102060 &dark royal blue; &DARK ROYAL BLUE; 0, 22, 170
royal blue 101061, 102061 &royal blue; &ROYAL BLUE; 0, 32, 255
light royal blue 101062, 102062 &light royal blue; &LIGHT ROYAL BLUE; 128, 144, 255
dark blue 101064, 102064 &dark blue; &DARK BLUE; 0, 0, 170
blue 101065, 102065 &blue; &BLUE; 0, 0, 255
light blue 101066, 102066 &light blue; &LIGHT BLUE; 128, 128, 255
dark admiral 101068, 102068 &dark admiral; &DARK ADMIRAL; 43, 0, 170
admiral 101069, 102069 &admiral; &ADMIRAL; 64, 0, 255
light admiral 10106a, 10206a &light admiral; &LIGHT ADMIRAL; 160, 128, 255
dark ultramarine 10106c, 10206c &dark ultramarine; &DARK ULTRAMARINE; 64, 0, 170
ultramarine 10106d, 10206d &ultramarine; &ULTRAMARINE; 96, 0, 255
light ultramarine 10106e, 10206e &light ultramarine; &LIGHT ULTRAMARINE; 176, 128, 255
dark violet 101070, 102070 &dark violet; &DARK VIOLET; 86, 0, 170
violet 101071, 102071 &violet; &VIOLET; 128, 0, 255
light violet 101072, 102072 &light violet; &LIGHT VIOLET; 192, 128, 255
dark purple 101074, 102074 &dark purple; &DARK PURPLE; 107, 0, 170
purple 101075, 102075 &purple; &PURPLE; 160, 0, 255
light purple 101076, 102076 &light purple; &LIGHT PURPLE; 208, 128, 255
dark electric 101078, 102078 &dark electric; &DARK ELECTRIC; 128, 0, 170
electric 101079, 102079 &electric; &ELECTRIC; 192, 0, 255
light electric 10107a, 10207a &light electric; &LIGHT ELECTRIC; 224, 128, 255
dark phlox 10107c, 10207c &dark phlox; &DARK PHLOX; 150, 0, 170
phlox 10107d, 10207d &phlox; &PHLOX; 224, 0, 255
light phlox 10107e, 10207e &light phlox; &LIGHT PHLOX; 240, 128, 255
dark magenta 101080, 102080 &dark magenta; &DARK MAGENTA; 170, 0, 170
magenta 101081, 102081 &magenta; &MAGENTA; 255, 0, 255
light magenta 101082, 102082 &light magenta; &LIGHT MAGENTA; 255, 128, 255
dark pink 101084, 102084 &dark pink; &DARK PINK; 170, 0, 128
pink 101085, 102085 &pink; &PINK; 255, 0, 192
light pink 101086, 102086 &light pink; &LIGHT PINK; 255, 128, 224
dark carmine 101088, 102088 &dark carmine; &DARK CARMINE; 170, 0, 86
carmine 101089, 102089 &carmine; &CARMINE; 255, 0, 128
light carmine 10108a, 10208a &light carmine; &LIGHT CARMINE; 255, 128, 192
dark cold red 10108c, 10208c &dark cold red; &DARK COLD RED; 170, 0, 43
cold red 10108d, 10208d &cold red; &COLD RED; 255, 0, 64
light cold red 10108e, 10208e &light cold red; &LIGHT COLD RED; 255, 128, 160
dark brown 101090, 102090 &dark brown; &DARK BROWN; 100, 50, 0
brown 101091, 102091 &brown; &BROWN; 150, 75, 0
light brown 101092, 102092 &light brown; &LIGHT BROWN; 203, 166, 128
dark beige 101094, 102094 &dark beige; &DARK BEIGE; 164, 164, 147
beige 101095, 102095 &beige; &BEIGE; 245, 245, 220
light beige 101096, 102096 &light beige; &LIGHT BEIGE; 251, 251, 238
dark tan 101098, 102098 &dark tan; &DARK TAN; 140, 120, 94
tan 101099, 102099 &tan; &TAN; 210, 180, 140
light tan 10109a, 10209a &light tan; &LIGHT TAN; 233, 218, 198
dark salmon 101098, 102098 &dark salmon; &DARK SALMON; 170, 97, 110
salmon 101099, 102099 &salmon; &SALMON; 255, 145, 164
light salmon 10109a, 10209a &light salmon; &LIGHT SALMON; 255, 201, 210

Console Theme Colors

In addition to static colors, theme colors can be chosen. When B4P starts, some initial colors are assigned, however they can be reassigned to different colors by changing the color names or hexadecimal RGB values (#RRGGBB format) in console[theme colors,theme color name] = New color name;

The theme colors listed in the 1st column below can also be used with the functions text color() and background color().

Theme color name UNICODE (hex) Character Entity Names RBG Color Code
neutral 101100, 102100 &neutral; &NEUTRAL;
high 101101, 102101 &high; &HIGH;
medium 101102, 102102 &medium; &MEDIUM;
low 101103, 102103 &low; &LOW;
bad 101104, 102104 &bad; &BAD;
warning 101105, 102105 &warning; &WARNING;
info 101106, 102106 &info; &INFO;
ok 101107, 102107 &ok; &OK;
start 101108, 102108 &start; &START;
active 101109, 102109 &active; &ACTIVE;
pause 10110a, 10210a &pause; &PAUSE;
done 10110b, 10210b &done; &DONE;
accent 1 10110c, 10210c &accent 1; &ACCENT 1;
accent 2 10110d, 10210d &accent 2; &ACCENT 2;
accent 3 10110e, 10210e &accent 3; &ACCENT 3;
accent 4 10110f, 10210f &accent 4; &ACCENT 4;
deco 1 101110, 102110 &deco 1; &DECO 1;
deco 2 101111, 102111 &deco 2; &DECO 2;
deco 3 101112, 102112 &deco 3; &DECO 3;
deco 4 101113, 102113 &deco 4; &DECO 4;

Other Special Output Characters

A limted number of navigation key characters can also be used as output characters in roder to move the cursor:

Key Character UNICODE (hex) Character Entity Name Action
Arrow up 108008 &arrow-up; Cursor up 1 row
Arrow down 108002 &arrow-down; Cursor down 1 row
Arrow left 108004 &arrow-left; Cursor left 1 row
Arrow right 108006 &arrow-right; Cursor right 1 row
Home 108007 &home; Cursor to 1st column
ctrl-Home 108107 &ctrl-home; Cursor to top left