24 bit Color umwandeln
Verfasst: Donnerstag 11. August 2016, 16:58
hallo Liebe Python Community,
ich habe folgendes Problem und zwar versuche ich die Aktuelle Funktion umzukehren.
leider funktionier mein code nicht :-/
Ist das irgendwie möglich die 24 bit Color zurück umzuwandeln?
danke für eure Hilfe.
mfg: Ace
ich habe folgendes Problem und zwar versuche ich die Aktuelle Funktion umzukehren.
Code: Alles auswählen
def Color(red, green, blue):
"""Convert the provided red, green, blue color to a 24-bit color value.
Each color component should be a value 0-255 where 0 is the lowest intensity
and 255 is the highest intensity.
"""
return (red << 16) | (green << 8) | blue
Code: Alles auswählen
def ColortoRGB(color):
r = color >> 16
g = color >> 8
b = color
return [r,g,b]
danke für eure Hilfe.
mfg: Ace