code: def inxsearch(self, r, g, b):
          
          dists = (self.colormap[:, :3] - np.array([r, g, b]))
          a = np.argmin((dists * dists).sum(1))
          return a
docs: Search for BGR values 0..255 and return colour index