about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--071print.mu16
-rw-r--r--repl.mu2
2 files changed, 15 insertions, 3 deletions
diff --git a/071print.mu b/071print.mu
index d7edf7ae..db7c97d1 100644
--- a/071print.mu
+++ b/071print.mu
@@ -420,13 +420,19 @@ recipe print-string [
   default-space:address:array:location <- new location:type, 30:literal
   x:address:screen <- next-ingredient
   s:address:array:character <- next-ingredient
+  color:number, color-found?:boolean <- next-ingredient
+  {
+    # default color to white
+    break-if color-found?:boolean
+    color:number <- copy 7:literal/white
+  }
   len:number <- length s:address:array:character/deref
   i:number <- copy 0:literal
   {
     done?:boolean <- greater-or-equal i:number, len:number
     break-if done?:boolean
     c:character <- index s:address:array:character/deref, i:number
-    print-character x:address:screen c:character
+    print-character x:address:screen, c:character, color:number
     i:number <- add i:number, 1:literal
     loop
   }
@@ -437,8 +443,14 @@ recipe print-integer [
   default-space:address:array:location <- new location:type, 30:literal
   x:address:screen <- next-ingredient
   n:number <- next-ingredient
+  color:number, color-found?:boolean <- next-ingredient
+  {
+    # default color to white
+    break-if color-found?:boolean
+    color:number <- copy 7:literal/white
+  }
   # todo: other bases besides decimal
   s:address:array:character <- integer-to-decimal-string n:number
-  print-string x:address:screen, s:address:array:character
+  print-string x:address:screen, s:address:array:character, color:number
   reply x:address:screen/same-as-ingredient:0
 ]
diff --git a/repl.mu b/repl.mu
index 008e79b7..93d4fd72 100644
--- a/repl.mu
+++ b/repl.mu
@@ -5,7 +5,7 @@ recipe main [
   switch-to-display
   msg:address:array:character <- new [ready! type in an instruction, then hit enter. ctrl-d exits.
 ]
-  0:literal/real-screen <- print-string 0:literal/real-screen, msg:address:array:character
+  0:literal/real-screen <- print-string 0:literal/real-screen, msg:address:array:character, 245:literal/grey
   0:literal/real-keyboard, 0:literal/real-screen <- color-session 0:literal/real-keyboard, 0:literal/real-screen
 #?   wait-for-key-from-keyboard #? 1
   return-to-console