-- | Compute the ANSI colours corresponding to an Idris colour
mkSGR :: IdrisColour -> [SGR]
mkSGR (IdrisColour c v u b i) =
    fg c ++
    [SetUnderlining SingleUnderline | u] ++
    [SetConsoleIntensity BoldIntensity | b] ++
    [SetItalicized True | i]
  where
    fg Nothing = []
    fg (Just c) = [SetColor Foreground (if v then Vivid else Dull) c]

-- | Set the colour of a string using POSIX escape codes
mkSGR :: IdrisColour -> [SGR]
mkSGR (IdrisColour c v u b i) =
    fg c ++
    [SetUnderlining SingleUnderline | u] ++
    [SetConsoleIntensity BoldIntensity | b] ++
    [SetItalicized True | i]
  where
    fg Nothing = []
    fg (Just c) = [SetColor Foreground (if v then Vivid else Dull) c]

-- | Set the colour of a string using POSIX escape codes
mkSGR (IdrisColour c v u b i) =
    fg c ++
    [SetUnderlining SingleUnderline | u] ++
    [SetConsoleIntensity BoldIntensity | b] ++
    [SetItalicized True | i]
  where
    fg Nothing = []
    fg (Just c) = [SetColor Foreground (if v then Vivid else Dull) c]

-- | Set the colour of a string using POSIX escape codes