cminv ch=chname

        Invert the color map in the channel/viewer
12196
def cmd_cminv(self, ch=None):
        
        viewer = self.get_viewer(ch)
        if viewer is None:
            self.log("No current viewer/channel.")
            return

        viewer.invert_cmap()
1284683
def _invert(self):
        
        result = defaultdict(dict)
        for test_context, src_context in six.iteritems(self.data):
            for src, lines in six.iteritems(src_context):
                result[src][test_context] = lines
        return result
88582
def select_cb(self, viewer, event, data_x, data_y):
        
        if not (self._cmxoff <= data_x < self._cmwd):
            # need to click within the width of the bar
            return

        i = int(data_y / (self._cmht + self._cmsep))
        if 0 <= i < len(self.cm_names):
            name = self.cm_names[i]
            msg = "cmap => '%s'" % (name)
            self.logger.info(msg)

            channel = self.fv.get_channel_info()
            if channel is not None:
                viewer = channel.fitsimage
                #viewer.onscreen_message(msg, delay=0.5)
                viewer.set_color_map(name)
1148364
def delete_channel_cb(self, viewer, channel):
        """"""
        chname = channel.name
        del self.name_dict[chname]

        # Unhighlight
        un_hilite_set = set([])
        for path in self._hl_path:
            if path[0] == chname:
                un_hilite_set.add(path)
        self._hl_path -= un_hilite_set

        if self.gui_up:
            self.recreate_toc()

        self._rebuild_channels()
1207784
def code2color(color_string):
    """"""

    color_tuple = ast.literal_eval(color_string)
    color_tuple_int = map(lambda x: int(x * 255.0), color_tuple)

    return wx.Colour(*color_tuple_int)
556397
public static GrayU8 invert(GrayU8 input, int max , GrayU8 output) {
		output = InputSanityCheck.checkDeclare(input, output);

		ImplGrayImageOps.invert(input,max,output);

		return output;
	}
630882
def contrast(self, value):
        
        assert(0x00 <= value <= 0xFF)
        self._contrast = value
        self._ws.ws2811_channel_t_brightness_set(self._channel, value)
        self._flush()
770840
def read_colormap(fh, byteorder, dtype, count, offsetsize):
    """"""
    cmap = fh.read_array(byteorder+dtype[-1], count)
    cmap.shape = (3, -1)
    return cmap
982331
def cmd_lsch(self):
        
        names = list(self.fv.get_channel_names())
        names.sort()

        if len(names) == 0:
            self.log("No channels")
            return

        res = []
        cur_ch = self.fv.get_channel_info()
        for name in names:
            if (cur_ch is not None) and (cur_ch.name == name):
                res.append("=>%s" % (name))
            else:
                res.append("  %s" % (name))

        self.log("\n".join(res))
958509
def MWColorMapping(maptype='jet', reverse=True):
     
    d = {'A':89,'R':174,'N':132,'D':133,'C':121,'Q':146,'E':147,\
         'G':75,'H':155,'I':131,'L':131,'K':146,'M':149,'F':165,\
         'P':115,'S':105,'T':119,'W':204,'Y':181,'V':117}
    
    aas = sorted(AA_TO_INDEX.keys())
    mws  = [d[aa] for aa in aas]
    if reverse:
        mws = [-1 * x for x in mws]
    mapper = pylab.cm.ScalarMappable(cmap=maptype)
    mapper.set_clim(min(mws), max(mws))
    mapping_d = {'*':'#000000'}
    for (aa, h) in zip(aas, mws):
        tup = mapper.to_rgba(h, bytes=True)
        (red, green, blue, alpha) = tup
        mapping_d[aa] = '#%02x%02x%02x' % (red, green, blue)
        assert len(mapping_d[aa]) == 7
    cmap = mapper.get_cmap()
    return (cmap, mapping_d, mapper)
594090
def _resolve_color(self, color):
        """"""
        # TODO: Does curses automatically exchange red and blue and cyan and
        # yellow when a terminal supports setf/setb rather than setaf/setab?
        # I'll be blasted if I can find any documentation. The following
        # assumes it does.
        color_cap = (self._background_color if 'on_' in color else
                     self._foreground_color)
        # curses constants go up to only 7, so add an offset to get at the
        # bright colors at 8-15:
        offset = 8 if 'bright_' in color else 0
        base_color = color.rsplit('_', 1)[-1]
        return self._formatting_string(
            color_cap(getattr(curses, 'COLOR_' + base_color.upper()) + offset))
933879
def add_channel_cb(self, viewer, channel):
        """"""
        chname = channel.name

        # add old highlight set to channel external data
        channel.extdata.setdefault('contents_old_highlight', set([]))

        # Add the channel to the treeview
        file_dict = {}
        self.name_dict.setdefault(chname, file_dict)

        if not self.gui_up:
            return False

        tree_dict = {chname: {}}
        if self.gui_up:
            self.treeview.add_tree(tree_dict)

        self._rebuild_channels()
1286807
def hue(self, hue):
        
        return self._build_command(0x40, self.convert_hue(hue),
                                   select=True, select_command=self.on())
1167397
def rgbmap_cb(self, rgbmap, channel):
        
        if not self.gui_up:
            return
        fitsimage = channel.fitsimage
        if fitsimage != self.fv.getfocus_fitsimage():
            return False
        self.change_cbar(self.fv, channel)
481987
def OnBGColor(self, event):
        """"""

        color = event.GetValue().GetRGB()

        post_command_event(self, self.BackgroundColorMsg, color=color)
748002
function(layerNameToHighlight) {
				var i, curNames = [], numLayers = svgCanvas.getCurrentDrawing().getNumLayers();
				for (i = 0; i < numLayers; i++) {
					curNames[i] = svgCanvas.getCurrentDrawing().getLayerName(i);
				}

				if (layerNameToHighlight) {
					for (i = 0; i < numLayers; ++i) {
						if (curNames[i] != layerNameToHighlight) {
							svgCanvas.getCurrentDrawing().setLayerOpacity(curNames[i], 0.5);
						}
					}
				} else {
					for (i = 0; i < numLayers; ++i) {
						svgCanvas.getCurrentDrawing().setLayerOpacity(curNames[i], 1.0);
					}
				}
			}
512731
public static GrayF32 invert(GrayF32 input, float max , GrayF32 output) {
		output = InputSanityCheck.checkDeclare(input, output);

		ImplGrayImageOps.invert(input,max,output);

		return output;
	}