yi-emacs-colours-0.1.0.1: Simple mapping from colour names used in emacs to Color

LicenseGPL-2
Safe HaskellSafe-Inferred
LanguageHaskell2010

Yi.Style.EmacsColours.Internal

Description

Copyright : © Mateusz Kowalczyk, 2014 Maintainer : fuuzetsu@fuuzetsu.co.uk Stability : experimental Portability : portable

Internal-use module.

Synopsis

Documentation

rgb :: Word32 -> Color Source

Convenience function

data ColInfo Source

Temporary type to carry colour info we need for conversion to string

Constructors

ColInfo 

Instances

toHaskell :: String -> String Source

Takes a string that looks like this:

255 250 250	#fffafa	snow	snow
248 248 255	#f8f8ff	ghost white	ghost white
248 248 255	#f8f8ff	GhostWhite	GhostWhite

and massages it to spit out a ready-to-go series of functions. Make sure to add the imports and module headers and just splice in the rest.

You might use it as

readFile "tmpcolors" >>= writeFile "tmpcolout" . toHaskell

colToHaskell :: String -> ColInfo -> String Source

Coerce colour info into Haskell function thing

mkFn :: [String] -> Maybe String Source

Massage first possible name into Haskell function name

mkCol :: String -> Maybe ColInfo Source

Parse out data from a line