def is_gray(self): return (alltrue(self._lut[:, 0] == self._lut[:, 1]) and alltrue(self._lut[:, 0] == self._lut[:, 2]))
def _is_sorted(self, x): "return true if x is sorted" if len(x)<2: return 1 return alltrue(x[1:]-x[0:-1]>=0)
def is_gray(self): return (alltrue(self._lut[:,0] == self._lut[:,1]) and alltrue(self._lut[:,0] == self._lut[:,2]))