yi-language-0.19.2: Collection of language-related Yi libraries.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Yi.Style

Description

Colors and friends.

Synopsis

- data Attributes = Attributes {
  - foreground :: !Color
  - background :: !Color
  - reverseAttr :: !Bool
  - bold :: !Bool
  - italic :: !Bool
  - underline :: !Bool
  }
- emptyAttributes :: Attributes
- type Style = Endo Attributes
- data UIStyle = UIStyle {
  - modelineAttributes :: Attributes
  - modelineFocusStyle :: Style
  - tabBarAttributes :: Attributes
  - tabInFocusStyle :: Style
  - tabNotFocusedStyle :: Style
  - baseAttributes :: Attributes
  - selectedStyle :: Style
  - eofStyle :: Style
  - errorStyle :: Style
  - hintStyle :: Style
  - strongHintStyle :: Style
  - commentStyle :: Style
  - blockCommentStyle :: Style
  - keywordStyle :: Style
  - numberStyle :: Style
  - preprocessorStyle :: Style
  - stringStyle :: Style
  - longStringStyle :: Style
  - typeStyle :: Style
  - dataConstructorStyle :: Style
  - importStyle :: Style
  - builtinStyle :: Style
  - regexStyle :: Style
  - variableStyle :: Style
  - operatorStyle :: Style
  - quoteStyle :: Style
  - makeFileAction :: Style
  - makeFileRuleHead :: Style
  }
- type StyleName = UIStyle -> Style
- withFg :: Color -> Style
- withBg :: Color -> Style
- withBd :: Bool -> Style
- withItlc :: Bool -> Style
- withUnderline :: Bool -> Style
- withReverse :: Bool -> Style
- defaultStyle :: StyleName
- data Color
  - = RGB !Word8 !Word8 !Word8
  - | Default
- colorToText :: Color -> String
- black :: Color
- grey :: Color
- lightGrey :: Color
- darkred :: Color
- red :: Color
- darkgreen :: Color
- green :: Color
- brown :: Color
- yellow :: Color
- darkblue :: Color
- blue :: Color
- purple :: Color
- magenta :: Color
- darkcyan :: Color
- cyan :: Color
- white :: Color
- brightwhite :: Color

# Documentation

data Attributes Source #

Visual text attributes to be applied during layout.

Constructors

Attributes |

Fields

- foreground :: !Color
- background :: !Color
- reverseAttr :: !Bool

  The text should be show as "active" or "selected". This can be implemented by reverse video on the terminal.

- bold :: !Bool
- italic :: !Bool
- underline :: !Bool

#### Instances

Instances details

Show Attributes Source # |
Instance details Defined in Yi.Style Methods showsPrec :: Int -> Attributes -> ShowS Source # show :: Attributes -> String Source # showList :: [Attributes] -> ShowS Source #
Eq Attributes Source # |
Instance details Defined in Yi.Style Methods (==) :: Attributes -> Attributes -> Bool Source # (/=) :: Attributes -> Attributes -> Bool Source #
Ord Attributes Source # |

Instance details

Defined in Yi.Style

Methods

compare :: Attributes -> Attributes -> Ordering Source #

(<) :: Attributes -> Attributes -> Bool Source #

(<=) :: Attributes -> Attributes -> Bool Source #

(>) :: Attributes -> Attributes -> Bool Source #

(>=) :: Attributes -> Attributes -> Bool Source #

max :: Attributes -> Attributes -> Attributes Source #

min :: Attributes -> Attributes -> Attributes Source #

emptyAttributes :: Attributes Source #

type Style = Endo Attributes Source #

The style is used to transform attributes by modifying one or more of the visual text attributes.

data UIStyle Source #

The UI type

Constructors

UIStyle |

Fields

- modelineAttributes :: Attributes

  ground attributes for the modeline

- modelineFocusStyle :: Style

  transformation of modeline in focus

- tabBarAttributes :: Attributes

  ground attributes for the tabbar

- tabInFocusStyle :: Style

  a tab that currently holds the focus

- tabNotFocusedStyle :: Style

  a tab that does not have the current focus

- baseAttributes :: Attributes

  ground attributes for the main text views

- selectedStyle :: Style

  the selected portion

- eofStyle :: Style

  empty file marker colours

- errorStyle :: Style

  indicates errors in text

- hintStyle :: Style

  search matchesparen matchesother hints

- strongHintStyle :: Style

  current search match

- commentStyle :: Style

  all comments

- blockCommentStyle :: Style

  additional only for block comments

- keywordStyle :: Style

  applied to language keywords

- numberStyle :: Style

  numbers

- preprocessorStyle :: Style

  preprocessor directive (often in Haskell or C)

- stringStyle :: Style

  constant strings

- longStringStyle :: Style

  additional style for long strings

- typeStyle :: Style

  type name (such as class in an OO language)

- dataConstructorStyle :: Style

  data constructor

- importStyle :: Style

  style of import names

- builtinStyle :: Style

  builtin things, e.g. Array in JavaScript

- regexStyle :: Style

  regular expressions

- variableStyle :: Style

  any standard variable (identifier)

- operatorStyle :: Style

  infix operators

- quoteStyle :: Style

  Style of a quotation (e.g. in template haskell)

- makeFileAction :: Style

  stuff that's passed to the shell in a Makefile

- makeFileRuleHead :: Style

  makefile rule headers

type StyleName = UIStyle -> Style Source #

A StyleName determines what style to use, taking into account the set of rendering preferences given by a `UIStyle`. Typically, style names will be `Style`-valued field names of `UIStyle`.

withFg :: Color -> Style Source #

A style that sets the foreground.

withBg :: Color -> Style Source #

A style that sets the background.

withBd :: Bool -> Style Source #

A style that sets the font to bold

withItlc :: Bool -> Style Source #

A style that sets the style to italics

withUnderline :: Bool -> Style Source #

A style that sets the style to underlined

withReverse :: Bool -> Style Source #

A style that sets the style to underlined

defaultStyle :: StyleName Source #

The identity transform.

data Color Source #

Constructors

RGB !Word8 !Word8 !Word8 |
Default | The system-default color of the engine used. e.g. in Gtk this should pick whatever the user has chosen as default color (background or foreground depending on usage) for the text.

#### Instances

Instances details

Show Color Source # |
Instance details Defined in Yi.Style Methods showsPrec :: Int -> Color -> ShowS Source # show :: Color -> String Source # showList :: [Color] -> ShowS Source #
Eq Color Source # |
Instance details Defined in Yi.Style Methods (==) :: Color -> Color -> Bool Source # (/=) :: Color -> Color -> Bool Source #
Ord Color Source # |
Instance details Defined in Yi.Style Methods compare :: Color -> Color -> Ordering Source # (<) :: Color -> Color -> Bool Source # (<=) :: Color -> Color -> Bool Source # (>) :: Color -> Color -> Bool Source # (>=) :: Color -> Color -> Bool Source # max :: Color -> Color -> Color Source # min :: Color -> Color -> Color Source #

colorToText :: Color -> String Source #

Convert a color to its text specification, as to be accepted by XParseColor

black :: Color Source #

grey :: Color Source #

lightGrey :: Color Source #

darkred :: Color Source #

red :: Color Source #

darkgreen :: Color Source #

green :: Color Source #

brown :: Color Source #

yellow :: Color Source #

darkblue :: Color Source #

blue :: Color Source #

purple :: Color Source #

magenta :: Color Source #

darkcyan :: Color Source #

cyan :: Color Source #

white :: Color Source #

brightwhite :: Color Source #