pretty-simple-4.1.2.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 Source #

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 Source # |
Instance details Defined in Text.Pretty.Simple.Internal.Color Associated Types type Rep ColorOptions :: Type -> Type Source # Methods from :: ColorOptions -> Rep ColorOptions x Source # to :: Rep ColorOptions x -> ColorOptions Source #
Show ColorOptions Source # |
Instance details Defined in Text.Pretty.Simple.Internal.Color Methods showsPrec :: Int -> ColorOptions -> ShowS Source # show :: ColorOptions -> String Source # showList :: [ColorOptions] -> ShowS Source #
Eq ColorOptions Source # |
Instance details Defined in Text.Pretty.Simple.Internal.Color Methods (==) :: ColorOptions -> ColorOptions -> Bool Source # (/=) :: ColorOptions -> ColorOptions -> Bool Source #
type Rep ColorOptions Source # |

Instance details

Defined in Text.Pretty.Simple.Internal.Color

type Rep ColorOptions = D1 ('MetaData "ColorOptions" "Text.Pretty.Simple.Internal.Color" "pretty-simple-4.1.2.0-4TMd0gltyA79c4xRwHHRh" '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 Source #

Default color options for use on a dark background.

defaultColorOptionsLightBg :: ColorOptions Source #

Default color options for use on a light background.

colorNull :: Style Source #

No styling.

data Style Source #

Ways to style terminal output.

Constructors

Style |

Fields

- styleColor :: Maybe (Color, Intensity)
- styleBold :: Bool
- styleItalic :: Bool
- styleUnderlined :: Bool

#### Instances

Instances details

Generic Style Source # |
Instance details Defined in Text.Pretty.Simple.Internal.Color Associated Types type Rep Style :: Type -> Type Source # Methods from :: Style -> Rep Style x Source # to :: Rep Style x -> Style Source #
Show Style Source # |
Instance details Defined in Text.Pretty.Simple.Internal.Color Methods showsPrec :: Int -> Style -> ShowS Source # show :: Style -> String Source # showList :: [Style] -> ShowS Source #
Eq Style Source # |
Instance details Defined in Text.Pretty.Simple.Internal.Color Methods (==) :: Style -> Style -> Bool Source # (/=) :: Style -> Style -> Bool Source #
type Rep Style Source # |

Instance details

Defined in Text.Pretty.Simple.Internal.Color

type Rep Style = D1 ('MetaData "Style" "Text.Pretty.Simple.Internal.Color" "pretty-simple-4.1.2.0-4TMd0gltyA79c4xRwHHRh" '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 Source #

colorBold :: Intensity -> Color -> Style Source #

convertStyle :: Style -> AnsiStyle Source #