aboutsummaryrefslogtreecommitdiff
path: root/lib/consolecolor/init.nom
diff options
context:
space:
mode:
Diffstat (limited to 'lib/consolecolor/init.nom')
-rw-r--r--lib/consolecolor/init.nom16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/consolecolor/init.nom b/lib/consolecolor/init.nom
index 606f4b6..3bb7edb 100644
--- a/lib/consolecolor/init.nom
+++ b/lib/consolecolor/init.nom
@@ -1,5 +1,6 @@
-#!/usr/bin/env nomsu -V6.15.13.8
-#
+#!/usr/bin/env nomsu -V7.0.0
+
+###
This file defines actions for ANSI console color escape codes.
test:
@@ -9,20 +10,21 @@ $colors = {
.normal = 0, ."reset color" = 0, .bright = 1, .bold = 1, .dim = 2, .italic = 3
.underscore = 4, ."slow blink" = 5, ."fast blink" = 6, .reverse = 7, .inverse = 7
.inverted = 7, .hidden = 8
- # There's some other codes, but they're not currently implemented
+
+ ### There's some other codes, but they're not currently implemented
.black = 30, .red = 31, .green = 32, .yellow = 33, .blue = 34, .magenta = 35
.cyan = 36, .white = 37, ."on black" = 40, ."on red" = 41, ."on green" = 42
."on yellow" = 43, ."on blue" = 44, ."on magenta" = 45, ."on cyan" = 46
."on white" = 47
}
-for $name = $colornum in $colors:
+for ($name = $colornum) in $colors:
(nomsu environment).($name, as lua id) =
for $text:
if $(COLOR ENABLED):
if $text:
- return "\x1B[\($colornum)m\$text\x1b[0m"
+ return "\027[\($colornum)m\($text)\027[0m"
..else:
- return "\x1B[\($colornum)m"
+ return "\027[\($colornum)m"
..else:
- return ($text or "")
+ return ($text or "") \ No newline at end of file