diff --git a/src/colors.py b/src/colors.py index d62b115..39d77a1 100644 --- a/src/colors.py +++ b/src/colors.py @@ -2,10 +2,10 @@ def closest_color(rgb,names): name="" mindist=float('inf') - for i in range(len(names)): - dist=(rgb[0]-names[i][1])**2+(rgb[1]-names[i][2])**2+(rgb[2]-names[i][3])**2 + for color in names: + dist=(rgb[0]-color[1])**2+(rgb[1]-color[2])**2+(rgb[2]-color[3])**2 if dist