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

LicenseMIT
MaintainerAlexander Isenko <alex.isenko@googlemail.com>
Safe HaskellSafe-Inferred
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"

to6Hex :: Int -> String Source

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

Example usage:

λ> to4Hex 255
"0000F8"

to4Hex :: Int -> String Source

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

Example usage:

λ> to4Hex 255
"00F8"

toHex :: Int -> String Source

toHex takes an Int and converts it into a hex String

Example usage:

λ> toHex 255
"F8"