PROBLEM 7 (12 pts) - Sorting colors by percieved luminance Write a function which receives as input a list of tuples, wh
Posted: Wed Apr 27, 2022 3:36 pm
PROBLEM 7 (12 pts) - Sorting colors by percieved luminance Write a function which receives as input a list of tuples, where each tuple represents a color in the RGB color model. def sortColorsByLuminance(listofRgbColors): In this model a color is represented by three values (the value of Red, Green and Blue), each varying from 0 to 255. The perceived luminance of a color is calculated as: Luminance = 0.3 R + 0.59 G + 0.11 B (Note: this is due to the fact that humans perceive some colors brighter, for example green is perceived brighter than blue). The function should return the list of colors sorted by luminance (brightest to darkest).