@@ -32,6 +32,7 @@ introText = vertCat $ map (string defAttr)
3232 , "The vty demo program will echo the events generated by the pressed keys."
3333 , "Below there is a 240 color box."
3434 , "Followed by a description of the 16 color pallete."
35+ , "Followed by tones of red using a 24-bit palette."
3536 , "If the 240 color box is not visible then the terminal"
3637 , "claims 240 colors are not supported."
3738 , "Try setting TERM to xterm-256color"
@@ -42,12 +43,19 @@ introText = vertCat $ map (string defAttr)
4243 , "¯\\_(ツ)_/¯ ¯\\_(ツ)_/¯ ¯\\_(ツ)_/¯ ¯\\_(ツ)_/¯"
4344 ]
4445
46+splitColorImages :: [Image] -> [[Image]]
47+splitColorImages [] = []
48+splitColorImages is = (take 20 is ++ [string defAttr " "]) : (splitColorImages (drop 20 is))
49+
50+fullcolorbox :: Image
51+fullcolorbox = vertCat $ map horizCat $ splitColorImages colorImages
52+ where
53+ colorImages = map (\i -> string (currentAttr `withBackColor` linearColor i 0 0) " ") [0..255]
54+
4555colorbox_240 :: Image
4656colorbox_240 = vertCat $ map horizCat $ splitColorImages colorImages
4757 where
4858 colorImages = map (\i -> string (currentAttr `withBackColor` Color240 i) " ") [0..239]
49− splitColorImages [] = []
50− splitColorImages is = (take 20 is ++ [string defAttr " "]) : (splitColorImages (drop 20 is))
5159
5260colorbox_16 :: Image
5361colorbox_16 = border <|> column0 <|> border <|> column1 <|> border <|> column2 <|> border
@@ -70,7 +78,7 @@ updateDisplay = do
7078 "Press ESC to exit. Events for keys below."
7179 eventLog <- foldMap (string defAttr) <$> get
7280 let pic = picForImage (info <-> eventLog)
73− `addToBottom` (introText <-> colorbox_240 <|> colorbox_16)
81+ `addToBottom` (introText <-> colorbox_240 <|> colorbox_16 <|> fullcolorbox)
7482 vty <- ask
7583 liftIO $ update vty pic
7684