yi- The Haskell-Scriptable Editor



Colors and friends.



data Attributes Source

Visual text attributes to be applied during layout.




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

type Style = Endo AttributesSource

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

data UIStyle Source

The UI type




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


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 -> StyleSource

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.

withItlc :: Bool -> StyleSource

A style that sets the foreground.

A style that sets the background.

defaultStyle :: StyleNameSource

A style that sets the font to bold

A style that sets the style to italics

A style that sets the style to underlined

A style that sets the style to underlined

The identity transform.

data Color Source


RGB !Word8 !Word8 !Word8 

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 forground depending on usage) for the text.


colorToText :: Color -> StringSource

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