module Testlib.Printing where

import Prelude

yellow :: String
yellow :: String
yellow = String
"\x1b[38;5;11m"

blue :: String
blue :: String
blue = String
"\x1b[38;5;6m"

purpleish :: String
purpleish :: String
purpleish = String
"\x1b[38;5;13m"

orange :: String
orange :: String
orange = String
"\x1b[38;5;3m"

red :: String
red :: String
red = String
"\x1b[38;5;9m"

green :: String
green :: String
green = String
"\x1b[32m"

gray :: String
gray :: String
gray = String
"\x1b[38;5;250m"

resetColor :: String
resetColor :: String
resetColor = String
"\x1b[0m"

colored :: String -> String -> String
colored :: String -> String -> String
colored String
color String
s = String
color String -> String -> String
forall a. Semigroup a => a -> a -> a
<> String
s String -> String -> String
forall a. Semigroup a => a -> a -> a
<> String
resetColor

indent :: Int -> String -> String
indent :: Int -> String -> String
indent Int
n String
s =
  [String] -> String
unlines ((String -> String) -> [String] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map (String
pad <>) (String -> [String]
lines String
s))
  where
    pad :: String
pad = Int -> Char -> String
forall a. Int -> a -> [a]
replicate Int
n Char
' '

hline :: String
hline :: String
hline = Int -> Char -> String
forall a. Int -> a -> [a]
replicate Int
40 Char
'-'