pretty-simple-2.2.0.1: 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 | None
Language | Haskell2010

Text.Pretty.Simple.Internal.Color

Description

Synopsis

- data ColorOptions = ColorOptions {
  - colorQuote :: Builder
  - colorString :: Builder
  - colorError :: Builder
  - colorNum :: Builder
  - colorRainbowParens :: [Builder]
  }
- defaultColorOptionsDarkBg :: ColorOptions
- defaultColorQuoteDarkBg :: Builder
- defaultColorStringDarkBg :: Builder
- defaultColorErrorDarkBg :: Builder
- defaultColorNumDarkBg :: Builder
- defaultColorRainbowParensDarkBg :: [Builder]
- defaultColorOptionsLightBg :: ColorOptions
- defaultColorQuoteLightBg :: Builder
- defaultColorStringLightBg :: Builder
- defaultColorErrorLightBg :: Builder
- defaultColorNumLightBg :: Builder
- defaultColorRainbowParensLightBg :: [Builder]
- colorVividBlackBold :: Builder
- colorVividBlueBold :: Builder
- colorVividCyanBold :: Builder
- colorVividGreenBold :: Builder
- colorVividMagentaBold :: Builder
- colorVividRedBold :: Builder
- colorVividWhiteBold :: Builder
- colorVividYellowBold :: Builder
- colorDullBlackBold :: Builder
- colorDullBlueBold :: Builder
- colorDullCyanBold :: Builder
- colorDullGreenBold :: Builder
- colorDullMagentaBold :: Builder
- colorDullRedBold :: Builder
- colorDullWhiteBold :: Builder
- colorDullYellowBold :: Builder
- colorVividBlack :: Builder
- colorVividBlue :: Builder
- colorVividCyan :: Builder
- colorVividGreen :: Builder
- colorVividMagenta :: Builder
- colorVividRed :: Builder
- colorVividWhite :: Builder
- colorVividYellow :: Builder
- colorDullBlack :: Builder
- colorDullBlue :: Builder
- colorDullCyan :: Builder
- colorDullGreen :: Builder
- colorDullMagenta :: Builder
- colorDullRed :: Builder
- colorDullWhite :: Builder
- colorDullYellow :: Builder
- colorBold :: Builder
- colorReset :: Builder
- colorNull :: Builder
- colorHelper :: ColorIntensity -> Color -> Builder
- setSGRCodeBuilder :: [SGR] -> Builder

# Documentation

data ColorOptions Source #

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

For example, if you set `colorQuote` to something like `colorVividBlueBold`, then the quote character (`"`) will be output as bright blue in bold.

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

Constructors

ColorOptions |

Fields

- colorQuote :: Builder

  Color to use for quote characters (`"`) around strings.

- colorString :: Builder

  Color to use for strings.

- colorError :: Builder

  (currently not used)

- colorNum :: Builder

  (currently not used)

- colorRainbowParens :: [Builder]

  A list of `Builder` 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

Eq ColorOptions Source # |
Instance details Defined in Text.Pretty.Simple.Internal.Color Methods (==) :: ColorOptions -> ColorOptions -> Bool Source # (/=) :: ColorOptions -> ColorOptions -> Bool 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 #
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 #
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-2.2.0.1-8wtVJ8ANI1Y6MXsZeB7gq0" False) (C1 (MetaCons "ColorOptions" PrefixI True) ((S1 (MetaSel (Just "colorQuote") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Builder) :*: S1 (MetaSel (Just "colorString") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Builder)) :*: (S1 (MetaSel (Just "colorError") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Builder) :*: (S1 (MetaSel (Just "colorNum") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Builder) :*: S1 (MetaSel (Just "colorRainbowParens") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Builder])))))

defaultColorOptionsDarkBg :: ColorOptions Source #

Default color options for use on a dark background.

`colorQuote` is `defaultColorQuoteDarkBg`. `colorString` is `defaultColorStringDarkBg`. `colorError` is `defaultColorErrorDarkBg`. `colorNum` is `defaultColorNumDarkBg`. `colorRainbowParens` is `defaultColorRainboxParensDarkBg`.

defaultColorQuoteDarkBg :: Builder Source #

Default color for `colorQuote` for dark backgrounds. This is `colorVividWhiteBold`.

defaultColorStringDarkBg :: Builder Source #

Default color for `colorString` for dark backgrounds. This is `colorVividBlueBold`.

defaultColorErrorDarkBg :: Builder Source #

Default color for `colorError` for dark backgrounds. This is `colorVividRedBold`.

defaultColorNumDarkBg :: Builder Source #

Default color for `colorNum` for dark backgrounds. This is `colorVividGreenBold`.

defaultColorRainbowParensDarkBg :: [Builder] Source #

Default colors for `colorRainbowParens` for dark backgrounds.

defaultColorOptionsLightBg :: ColorOptions Source #

Default color options for use on a light background.

`colorQuote` is `defaultColorQuoteLightBg`. `colorString` is `defaultColorStringLightBg`. `colorError` is `defaultColorErrorLightBg`. `colorNum` is `defaultColorNumLightBg`. `colorRainbowParens` is `defaultColorRainboxParensLightBg`.

defaultColorQuoteLightBg :: Builder Source #

Default color for `colorQuote` for light backgrounds. This is `colorVividWhiteBold`.

defaultColorStringLightBg :: Builder Source #

Default color for `colorString` for light backgrounds. This is `colorVividBlueBold`.

defaultColorErrorLightBg :: Builder Source #

Default color for `colorError` for light backgrounds. This is `colorVividRedBold`.

defaultColorNumLightBg :: Builder Source #

Default color for `colorNum` for light backgrounds. This is `colorVividGreenBold`.

defaultColorRainbowParensLightBg :: [Builder] Source #

Default colors for `colorRainbowParens` for light backgrounds.

colorVividBlackBold :: Builder Source #

colorVividBlueBold :: Builder Source #

colorVividCyanBold :: Builder Source #

colorVividGreenBold :: Builder Source #

colorVividMagentaBold :: Builder Source #

colorVividRedBold :: Builder Source #

colorVividWhiteBold :: Builder Source #

colorVividYellowBold :: Builder Source #

colorDullBlackBold :: Builder Source #

colorDullBlueBold :: Builder Source #

colorDullCyanBold :: Builder Source #

colorDullGreenBold :: Builder Source #

colorDullMagentaBold :: Builder Source #

colorDullRedBold :: Builder Source #

colorDullWhiteBold :: Builder Source #

colorDullYellowBold :: Builder Source #

colorVividBlack :: Builder Source #

colorVividBlue :: Builder Source #

colorVividCyan :: Builder Source #

colorVividGreen :: Builder Source #

colorVividMagenta :: Builder Source #

colorVividRed :: Builder Source #

colorVividWhite :: Builder Source #

colorVividYellow :: Builder Source #

colorDullBlack :: Builder Source #

colorDullBlue :: Builder Source #

colorDullCyan :: Builder Source #

colorDullGreen :: Builder Source #

colorDullMagenta :: Builder Source #

colorDullRed :: Builder Source #

colorDullWhite :: Builder Source #

colorDullYellow :: Builder Source #

colorBold :: Builder Source #

Change the intensity to `BoldIntensity`.

colorReset :: Builder Source #

`Reset` the console color back to normal.

colorNull :: Builder Source #

Empty string.

colorHelper :: ColorIntensity -> Color -> Builder Source #

Helper for creating a `Builder` for an ANSI escape sequence color based on a `ColorIntensity` and a `Color`.

setSGRCodeBuilder :: [SGR] -> Builder Source #

Convert a list of `SGR` to a `Builder`.