So I was looking how to get a list of RGB colors depending on a desired total of colors to retrieve and I found this piece of code. And there's a part that I can't understand, I already read the notes where the ">>" and "&" operators are bitwise operators but I can't fully understand what they are doing.
Can anybody help me on understanding the part where the colors values are been assigned?
def getDinstinctRGBColorsList(desiredColors)
availableColors = 16000000
inc = availableColors/desiredColors
colorsList = {}
RGB = 0
count = 0
while count <= desiredColors:
RGB = RGB+inc
colorBlue = RGB & 255
colorGreen = (RGB >> 8) & 255
colorRed = (RGB >> 16) & 255
colorsList[count] = str(colorRed) + "," + str(colorGreen) + "," + str(colorBlue)
count += 1
return colorsList