UTFTConverter-0.1.0.1: Processing popular picture formats into .c or .raw format in RGB565

LicenseMIT
MaintainerAlexander Isenko <alex.isenko@googlemail.com>
Safe HaskellSafe
LanguageHaskell2010

Format.RGB565

Description

Format.RGB565 exports the functions to convert from a RGB value to RGB565 and the needed hex conversions

Synopsis

Documentation

toRGB565 :: (Word8, Word8, Word8) -> Int Source

toRGB565 takes a RGB value and converts it into a RGB565 encoded Int

Example usage:

λ> toRGB565 (255, 0, 0)
63488

toRGB565Hex :: (Word8, Word8, Word8) -> String Source

toRGB565Hex takes a RGB value and converts it into a RGB565 encoded 4 digit hex String

Example usage:

λ> toRGB565Hex (255, 0, 0)
"F800"

toNHex :: Int -> Int -> String Source

toNHex takes the desired stringlength n and an unsigned Int and converts it to a hex String and adds zeros until n digits are filled

Example usage:

λ> toNHex 4 255
"00FF"

λ> toNHex 6 255
"0000FF"

to6Hex :: Int -> String Source

Deprecated: Use toNHex 6 instead

to4Hex takes an unsigned Int and converts it to a hex String and adds zeros until six digits are filled

Example usage:

λ> to6Hex 255
"0000FF"

to4Hex :: Int -> String Source

Deprecated: Use toNHex 4 instead

to4Hex takes an unsigned Int and converts it to a hex String and adds zeros until four digits are filled

Example usage:

λ> to4Hex 255
"00FF"

toHex :: Int -> String Source

toHex takes an unsigned Int and converts it into a hex String

Example usage:

λ> toHex 255
"FF"