I'm using Python, and've got a dictionary like this.
COLORTABLE = {
0: (0, 0, 0),
1: (109, 111, 113),
2: (7, 145, 205),
3: (105, 156, 65),
4: (244, 126, 32),
5: (214, 22, 59),
6: (110, 26, 17),
7: (248, 222, 215),
8: (255, 255, 255),
9: (209, 211, 212),
10: (115, 207, 242),
11: (155, 204, 102),
12: (255, 236, 0),
13: (214, 128, 170),
14: (129, 36, 104),
15: (142, 104, 76),
}
How do I take an RGB tuple and match it to the closest tuple in the dictionary?
Should I loop through for each element in the source and find the closest match? This seems rather inefficient.