License | MIT |
---|---|
Maintainer | Alexander Isenko <alex.isenko@googlemail.com> |
Safe Haskell | Safe-Inferred |
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"
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"