From b6e1cffd9be3a91608dbf13318e8d892b8857179 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 6 Jun 2021 22:38:56 -0700 Subject: [PATCH] shell: concept of palettes --- shell/data.limg | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/shell/data.limg b/shell/data.limg index a88e03c0..780d7db9 100644 --- a/shell/data.limg +++ b/shell/data.limg @@ -201,24 +201,19 @@ (for y r (< y ymax) (+= y side) (for x r (< x xmax) (+= x side) (circle_rainbow screen x y (- r 100) 10)))))))]) + (Greys . [(define Greys + (map1 (fn(n) (+ n 15)) + (seq 16)))]) + (Pinks . [(define Pinks '(84 85 59 60 61 + 13 36 37 5 108))]) + (palette . [(def (palette p i) + (nth (% i (len p)) p))]) (task . [(def (task screen keyboard) (let (y c) '(0 0) (while (< y (height screen)) - (hline screen y (color c)) + (hline screen y (palette Greys c)) (+= y 3) (++ c))))]) - (color . [(def (color i) - (let palette - # greyscale -# '(16 17 18 19 20 21 22 23 -# 24 25 26 27 28 29 30 31) - # pink - '(13 5 36 37 59 60 61 84 - 85 108 132) - # pink sorted - '(84 85 59 60 61 13 36 37 - 5 108) - (nth (% i (len palette)) palette)))]) (main . [(def (main screen keyboard) (task screen keyboard))]) ))