FANSI globals (+palette and +c)

+Palette and +C globals for FANSI enabled games.

Author: Luigi@8BitMUSH
Category: Globals
Commands: @create.
Compatibility: TinyBit.

Instructions

Copy and paste the below code into a compatible MUSH or MUX.

MUSHCode for FANSI globals (+palette and +c)

@@ +PALETTE and +C globals for FANSI enabled games. Utilizes COLOR() and C() functions.
@@ See http://fansi.org for more information on FANSI.
@@
@@ +PALETTE displays all 256 colors, by number, in a friendly display.
@@ +C displays the extended ASCII characters, by number, in a friendly display.

@create FANSI Global Object
&+PALETTE FANSI Global Object=$+palette:@pem/s %#=[iter(lnum(0,15),color(0,##,rjust(##,4)),,)]%r[iter(lnum(0,5),iter(lnum(0,2),iter(lnum(0,5),color(0,setr(0,add(16,mul(itext(1),36),mul(itext(2),6),itext(0))),rjust(%q0,4)),,),,%b),,%r)]%r%r[iter(lnum(0,5),iter(lnum(3,5),iter(lnum(0,5),color(0,setr(0,add(16,mul(itext(1),36),mul(itext(2),6),itext(0))),rjust(%q0,4)),,),,%b),,%r)]%r%r[iter(lnum(232,255),color(0,##,rjust(##,4)),,)]
&+C FANSI Global Object=$+c:@pem/s %#=iter(lnum(33,126),[if(cand(gt(#@,1),eq(mod(#@,11),1)),%r)][rjust(##,4)]:[C(##)])%r[iter(1 3 4 5 6 14 15 16 17 18 19 20 21 22 23 24 25 26 28 29 30 31 32 [lnum(127,254)],[if(eq(mod(#@,11),1),%r)][rjust(##,4)]:[C(##)])]%r%rC\(<code>\) or C\(<code>\,<times>\)