Util fn to convert colours

This commit is contained in:
2024-05-15 21:50:16 +01:00
parent eba4797306
commit d1df47e195

5
utils.py Normal file
View File

@@ -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)