def set_color_mode(self, mode, dim,start_idx, end_idx, data): 
        if (mode == "default"):
            if (all([x in self.file_object.point_format.lookup for x in ("red", "green", "blue")])):
                if ((all(self.file_object.red[0:len(self.file_object):(len(self.file_object)/1000)] == 0)) and
                    (all(self.file_object.green[0:len(self.file_object):(len(self.file_object)/1000)] == 0)) and
                    (all(self.file_object.blue[0:len(self.file_object):(len(self.file_object)/1000)] == 0))):
                    print("Warning: Color data appears empty, using intensity mode. Specify -mode=rgb to override")
                    mode = "intensity"
                else:
                    mode="rgb"
            else:
                mode = "intensity" 
        if mode == "rgb" and not self.file_object.point_format.lookup in "red":
            print("Color data not found in file, using intensity")
            mode = "intensity"
        if mode in ["grey", "greyscale", "intensity"]:
            if type(self.allcolor) == bool:
                self.allcolor = self.file_object.reader.get_dimension(dim)/float(np.max(self.file_object.reader.get_dimension(dim)))
            scaled = self.allcolor[start_idx:end_idx] + 0.1
            col = np.array((np.vstack((scaled, scaled, scaled)).T), dtype = np.float32)
            data[:,3:6] += col
            return(data)
        elif (mode == "elevation" or (mode == "heatmap" and dim == "z")):
            if type(self.allcolor) == bool:
                self.allcolor = self.heatmap(self.file_object.z)
            col = self.allcolor[start_idx:end_idx]
            data[:,3:6] += col
            return(data)
        elif (mode == "heatmap" and dim != "z"):
            if type(self.allcolor) == bool:
                self.allcolor = self.heatmap(self.file_object.reader.get_dimension(dim))
            col = self.allcolor[start_idx:end_idx]
            data[:,3:6] += col
            return(data)
        elif mode == "rgb":
            _max = max(np.max(self.file_object.red), np.max(self.file_object.green), np.max(self.file_object.blue))
            _min = min(np.min(self.file_object.red), np.min(self.file_object.green), np.min(self.file_object.blue))
            diff = _max - _min
            col = np.array(np.vstack((self.file_object.red[start_idx:end_idx], self.file_object.green[start_idx:end_idx], self.file_object.blue[start_idx:end_idx])).T, dtype = np.float32)
            col -= _min
            col /= diff
            data[:,3:6] += col
            return(data)
dataset/ETHPy150Open grantbrown/laspy/laspy/glviewer.py/VBO_Provider.set_color_mode/swapped operands of `in`