def _distance_to_color(self, color):
        rgb = (int(color[1:3],16), int(color[3:5],16), int(color[5:7],16))
        return (self.r-rgb[0])**2 + (self.g-rgb[1])**2 + (self.b-rgb[2])**2
This computes the distance to a color, should be minimized.
dataset/ETHPy150Open tomerfiliba/plumbum/plumbum/colorlib/names.py/FindNearest._distance_to_color