License | MIT |
---|---|
Maintainer | Alexander Isenko <alex.isenko@googlemail.com> |
Safe Haskell | Safe |
Language | Haskell2010 |
Format.RGB565
exports the functions to convert from a RGB value to RGB565 and the needed hex conversions
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"