about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-25 18:08:18 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-25 18:08:23 -0700
commit64ac91c564a20e2ebf19ad211e987fbfc7fb2719 (patch)
tree22b074f8875a9d9d44e219dd9bf8c3effb1fff64
parent37568004a3b82668e0140ac49775f23b505720c6 (diff)
downloadmu-64ac91c564a20e2ebf19ad211e987fbfc7fb2719.tar.gz
1457 - print to display in color
Just foreground color for now.
-rw-r--r--070display.cc7
-rw-r--r--display.mu2
2 files changed, 7 insertions, 2 deletions
diff --git a/070display.cc b/070display.cc
index 2a2c51a7..1bfdb822 100644
--- a/070display.cc
+++ b/070display.cc
@@ -89,7 +89,12 @@ case PRINT_CHARACTER_TO_DISPLAY: {
     }
     break;
   }
-  tb_change_cell(Display_column, Display_row, c, TB_WHITE, TB_DEFAULT);
+  int color = TB_WHITE;
+  if (SIZE(ingredients) > 1) {
+    assert(scalar(ingredients.at(1)));
+    color = ingredients.at(1).at(0);
+  }
+  tb_change_cell(Display_column, Display_row, c, color, TB_DEFAULT);
   if (Display_column < width-1) {
     ++Display_column;
     tb_set_cursor(Display_column, Display_row);
diff --git a/display.mu b/display.mu
index a0c33e5d..dc083789 100644
--- a/display.mu
+++ b/display.mu
@@ -2,7 +2,7 @@
 
 recipe main [
   switch-to-display
-  print-character-to-display 97:literal
+  print-character-to-display 97:literal, 2:literal/red
   1:number/raw, 2:number/raw <- cursor-position-on-display
   wait-for-key-from-keyboard
   clear-display