X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=scheme.forth.jl.git;a=blobdiff_plain;f=term-colours.4th;h=1852a20a73c07d2f3f4a48777d0822451a526f88;hp=1d87c8e9d5eb8f2ef63092914a6c424b87710865;hb=3eaf389aa81bcfbf8dd64c89520925413d5c2390;hpb=df09a13220069056957cef14b72402e81069ba72 diff --git a/term-colours.4th b/term-colours.4th index 1d87c8e..1852a20 100644 --- a/term-colours.4th +++ b/term-colours.4th @@ -10,14 +10,6 @@ escape emit [char] 0 + emit escape-end ; -: reset-term - escape [char] 0 emit escape-end -; - -: bold - escape [char] 1 emit escape-end -; - : colour create , does> @@ -34,8 +26,22 @@ does> 6 colour cyan 7 colour white +: bold + escape [char] 1 emit escape-end +; + +: reset-term + escape [char] 0 emit escape-end +; + +: clear-term + escape [char] 2 emit [char] J emit + escape [char] 0 emit [char] ; emit [char] 0 emit [char] f emit +; + \ Example usage: \ fg red ( set fg colour to red ) \ bg green ( set bg colour to green ) \ bold ( use a bold font ) \ reset-term ( return everything to normal ) +\ clear-term ( clear terminal and return cursor to origin )