diff --git a/utils.py b/utils.py new file mode 100644 index 0000000..b701052 --- /dev/null +++ b/utils.py @@ -0,0 +1,5 @@ +class Utils: + # method from Tony Goodhew 21st April 2022, for thepihut.com + @staticmethod + def colour(R,G,B): # Convert RGB888 to RGB565 + return (((G&0b00011100)<<3) +((B&0b11111000)>>3)<<8) + (R&0b11111000)+((G&0b11100000)>>5) \ No newline at end of file