Commits

Stefan Saasen  committed 482a150

Color: Export bold, add doctest for the toAnsi function

  • Participants
  • Parent commits 6423385

Comments (0)

Files changed (1)

File src/Spy/Color.hs

   , yellow
   , Color(..)
   , Mode(..)
+  , bold
   , ansi
 ) where
 
 ansi :: Mode -> Color -> String -> String
 ansi m c s = "\x1b["++ toCode m c ++ "m" ++ s ++ "\x1b[0m"
 
--- "\033[1;34mT\033[0m"
 
 
+-- |
+-- >>> toCode Foreground Green
+-- "0;32"
+--
+-- >>> toCode Background LightPurple
+-- "1;45"
 toCode :: Mode -> Color -> String
 toCode m Black        = asAnsi m 0 0
 toCode m Blue         = asAnsi m 0 4