Skip to content

Instantly share code, notes, and snippets.

View joranmulderij's full-sized avatar

joranmulderij

View GitHub Profile
@ajfisher
ajfisher / colour_converter.py
Created May 30, 2012 06:56
Convert an 888 RGB value to 565 hex
# Author: Andrew Fisher
# Version: 0.1
# Date: 30/05/2012
# Licence: BSD
# This python converts an rgb value expressed in 8 bit values (eg 255, 128, 0) and returns a hex value that
# has been converted to 565 format. This was highly useful when I was playing with some Arduino
# stuff requiring 16 bit LCD designs and couldn't remember the hex layout.
def rgb_hex565(red, green, blue):