Text.Pretty.Simple.Internal.Color

pretty-simple-4.1.3.0: pretty printer for data types with a 'Show' instance.

Copyright | (c) Dennis Gosnell 2016
License | BSD-style (see LICENSE file)
Maintainer | cdep.illabout@gmail.com
Stability | experimental
Portability | POSIX
Safe Haskell | Safe-Inferred
Language | Haskell2010

Text.Pretty.Simple.Internal.Color

Description

Synopsis

- data ColorOptions = ColorOptions {
  - colorQuote :: Style
  - colorString :: Style
  - colorError :: Style
  - colorNum :: Style
  - colorRainbowParens :: [Style]
  }
- defaultColorOptionsDarkBg :: ColorOptions
- defaultColorOptionsLightBg :: ColorOptions
- colorNull :: Style
- data Style = Style {
  - styleColor :: Maybe (Color, Intensity)
  - styleBold :: Bool
  - styleItalic :: Bool
  - styleUnderlined :: Bool
  }
- color :: Intensity -> Color -> Style
- colorBold :: Intensity -> Color -> Style
- convertStyle :: Style -> AnsiStyle

# Documentation

data ColorOptions #

These options are for colorizing the output of functions like `pPrint`.

If you don't want to use a color for one of the options, use `colorNull`.

Constructors

ColorOptions |
Fields colorQuote :: Style Color to use for quote characters (`"`) around strings. colorString :: Style Color to use for strings. colorError :: Style Color for errors, e.g. unmatched brackets. colorNum :: Style Color to use for numbers. colorRainbowParens :: [Style] A list of colors to use for rainbow parenthesis output. Use '[]' if you don't want rainbow parenthesis. Use just a single item if you want all the rainbow parenthesis to be colored the same.

#### Instances

Instances details

Generic ColorOptions # |
Instance details Defined in Text.Pretty.Simple.Internal.Color Associated Types
type Rep ColorOptions |
Instance details Defined in Text.Pretty.Simple.Internal.Color type Rep ColorOptions = D1 ('MetaData "ColorOptions" "Text.Pretty.Simple.Internal.Color" "pretty-simple-4.1.3.0-Cc8OKns9u1XI0xrwHYW9Yv" 'False) (C1 ('MetaCons "ColorOptions" 'PrefixI 'True) ((S1 ('MetaSel ('Just "colorQuote") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style) :*: S1 ('MetaSel ('Just "colorString") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style)) :*: (S1 ('MetaSel ('Just "colorError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style) :*: (S1 ('MetaSel ('Just "colorNum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style) :*: S1 ('MetaSel ('Just "colorRainbowParens") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Style])))))
Methods from :: ColorOptions -> Rep ColorOptions x # to :: Rep ColorOptions x -> ColorOptions #
Show ColorOptions # |
Instance details Defined in Text.Pretty.Simple.Internal.Color Methods showsPrec :: Int -> ColorOptions -> ShowS # show :: ColorOptions -> String # showList :: [ColorOptions] -> ShowS #
Eq ColorOptions # |
Instance details Defined in Text.Pretty.Simple.Internal.Color Methods (==) :: ColorOptions -> ColorOptions -> Bool # (/=) :: ColorOptions -> ColorOptions -> Bool #
type Rep ColorOptions # |
Instance details Defined in Text.Pretty.Simple.Internal.Color type Rep ColorOptions = D1 ('MetaData "ColorOptions" "Text.Pretty.Simple.Internal.Color" "pretty-simple-4.1.3.0-Cc8OKns9u1XI0xrwHYW9Yv" 'False) (C1 ('MetaCons "ColorOptions" 'PrefixI 'True) ((S1 ('MetaSel ('Just "colorQuote") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style) :*: S1 ('MetaSel ('Just "colorString") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style)) :*: (S1 ('MetaSel ('Just "colorError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style) :*: (S1 ('MetaSel ('Just "colorNum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style) :*: S1 ('MetaSel ('Just "colorRainbowParens") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Style])))))

defaultColorOptionsDarkBg :: ColorOptions #

Default color options for use on a dark background.

defaultColorOptionsLightBg :: ColorOptions #

Default color options for use on a light background.

colorNull :: Style #

No styling.

data Style #

Ways to style terminal output.

Constructors

Style |
Fields styleColor :: Maybe (Color, Intensity) styleBold :: Bool styleItalic :: Bool styleUnderlined :: Bool

#### Instances

Instances details

Generic Style # |
Instance details Defined in Text.Pretty.Simple.Internal.Color Associated Types
type Rep Style |
Instance details Defined in Text.Pretty.Simple.Internal.Color type Rep Style = D1 ('MetaData "Style" "Text.Pretty.Simple.Internal.Color" "pretty-simple-4.1.3.0-Cc8OKns9u1XI0xrwHYW9Yv" 'False) (C1 ('MetaCons "Style" 'PrefixI 'True) ((S1 ('MetaSel ('Just "styleColor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Color, Intensity))) :*: S1 ('MetaSel ('Just "styleBold") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "styleItalic") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "styleUnderlined") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))
Methods from :: Style -> Rep Style x # to :: Rep Style x -> Style #
Show Style # |
Instance details Defined in Text.Pretty.Simple.Internal.Color Methods showsPrec :: Int -> Style -> ShowS # show :: Style -> String # showList :: [Style] -> ShowS #
Eq Style # |
Instance details Defined in Text.Pretty.Simple.Internal.Color Methods (==) :: Style -> Style -> Bool # (/=) :: Style -> Style -> Bool #
type Rep Style # |
Instance details Defined in Text.Pretty.Simple.Internal.Color type Rep Style = D1 ('MetaData "Style" "Text.Pretty.Simple.Internal.Color" "pretty-simple-4.1.3.0-Cc8OKns9u1XI0xrwHYW9Yv" 'False) (C1 ('MetaCons "Style" 'PrefixI 'True) ((S1 ('MetaSel ('Just "styleColor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Color, Intensity))) :*: S1 ('MetaSel ('Just "styleBold") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "styleItalic") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "styleUnderlined") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))

color :: Intensity -> Color -> Style #

colorBold :: Intensity -> Color -> Style #

convertStyle :: Style -> AnsiStyle #