return a tuple describing the colour a waypoint should appear on the map
177778
def colour_for_wp(self, wp_num):
        ''''''
        wp = self.module('wp').wploader.wp(wp_num)
        command = wp.command
        return self._colour_for_wp_command.get(command, (0,255,0))
746577
def viewport(self) -> Tuple[int, int, int, int]:
        '''
            
        '''

        return self.mglo.viewport
854667
def make_color_tuple(color):
    
    R = color[1:3]
    G = color[3:5]
    B = color[5:7]

    R = int(R, 16)
    G = int(G, 16)
    B = int(B, 16)

    return R, G, B
619033
def colors():
  """"""
  enums = dict(
    TIME_LEFT="red",
    CONTEST_NAME="yellow",
    HOST="green",
    MISC="blue",
    TIME_TO_START="green",
  )

  return type('Enum', (), enums)
449312
def get_cmap(self):
        

        # now generate the colormap from the ordered list
        r = []
        g = []
        b = []
        for p in self._colorpoint_list:
            r.append((p[0], p[1][0]*1.0, p[2][0]*1.0))
            g.append((p[0], p[1][1]*1.0, p[2][1]*1.0))
            b.append((p[0], p[1][2]*1.0, p[2][2]*1.0))

        # store the formatted dictionary
        c = {'red':r, 'green':g, 'blue':b}

        # now set the dang thing
        return _mpl.colors.LinearSegmentedColormap('custom', c)
101537
def _get_text_color(self):
        """"""

        color = self.code_array.cell_attributes[self.key]["textcolor"]
        return tuple(c / 255.0 for c in color_pack2rgb(color))
1210667
def colored_map(text, cmap):
    
    if not __ISON: return text
    for key, v in cmap.items():
        if isinstance(v, dict):
            text = text.replace(key, colored(key, **v))
        else:
            text = text.replace(key, colored(key, color=v))
    return text
1232413
def get_colors(self, prefix, len_):
        """"""

        def color(tupl):
            """Make a color css"""
            return ((
                '%s.color-{0}, %s.color-{0} a:visited {{\n'
                '  stroke: {1};\n'
                '  fill: {1};\n'
                '}}\n'
            ) % (prefix, prefix)).format(*tupl)

        def value_color(tupl):
            """Make a value color css"""
            return ((
                '%s .text-overlay .color-{0} text {{\n'
                '  fill: {1};\n'
                '}}\n'
            ) % (prefix, )).format(*tupl)

        def ci_color(tupl):
            """Make a value color css"""
            if not tupl[1]:
                return ''
            return (('%s .color-{0} .ci {{\n'
                     '  stroke: {1};\n'
                     '}}\n') % (prefix, )).format(*tupl)

        if len(self.colors) < len_:
            missing = len_ - len(self.colors)
            cycles = 1 + missing // len(self.colors)
            colors = []
            for i in range(0, cycles + 1):
                for color_ in self.colors:
                    colors.append(darken(color_, 33 * i / cycles))
                    if len(colors) >= len_:
                        break
                else:
                    continue
                break
        else:
            colors = self.colors[:len_]

        # Auto compute foreground value color when color is missing
        value_colors = []
        for i in range(len_):
            if i < len(self.value_colors) and self.value_colors[i] is not None:
                value_colors.append(self.value_colors[i])
            else:
                value_colors.append(
                    'white' if is_foreground_light(colors[i]) else 'black'
                )

        return '\n'.join(
            chain(
                map(color, enumerate(colors)),
                map(value_color, enumerate(value_colors)),
                map(ci_color, enumerate(self.ci_colors))
            )
        )
102047
def :
        """"""

        if not self.colorspace or self.colorspace.n > 3:
            print("warning: colorspace invalid for function")
            return

        return _fitz.Pixmap_
1072045
def points(self, size=1.0, highlight=None, colorlist=None, opacity=1.0):
        
        if colorlist is None:
            colorlist = [get_atom_color(t) for t in self.topology['atom_types']]
        if highlight is not None:
            if isinstance(highlight, int):
                colorlist[highlight] = 0xff0000
            if isinstance(highlight, (list, np.ndarray)):
                for i in highlight:
                    colorlist[i] = 0xff0000

        sizes = [size] * len(self.topology['atom_types'])

        points = self.add_representation('points', {'coordinates': self.coordinates.astype('float32'),
                                                    'colors': colorlist,
                                                    'sizes': sizes,
                                                    'opacity': opacity})
        # Update closure
        def update(self=self, points=points):
            self.update_representation(points, {'coordinates': self.coordinates.astype('float32')})

        self.update_callbacks.append(update)
        self.autozoom(self.coordinates)
823727
def color(self, key=None):
        
        if key is not None:
            return self._colorMap.get(nativestring(key), self._color)
        return self._color
80474
def map_colors(arr, crange, cmap, hex=True):
    
    if isinstance(crange, np.ndarray):
        xsorted = np.argsort(crange)
        ypos = np.searchsorted(crange, arr)
        arr = xsorted[ypos]
    else:
        if isinstance(crange, tuple):
            cmin, cmax = crange
        else:
            cmin, cmax = np.nanmin(arr), np.nanmax(arr)
        arr = (arr - cmin) / (cmax-cmin)
        arr = np.ma.array(arr, mask=np.logical_not(np.isfinite(arr)))
    arr = cmap(arr)
    if hex:
        return rgb2hex(arr)
    else:
        return arr
890559
def color_map_data(self, data: numpy.ndarray) -> None:
        
        self.__color_map_data = data
        self.update()
429836
def to_s
      result = "Waypoint \n"
      result << "\tName: #{name}\n"
      result << "\tLatitude: #{lat} \n"
      result << "\tLongitude: #{lon} \n"
      result << "\tElevation: #{elevation}\n "
      result << "\tTime: #{time}\n"
      SUB_ELEMENTS.each do |sub_element_attribute|
        val = send(sub_element_attribute)
        result << "\t#{sub_element_attribute}: #{val}\n" unless val.nil?
      end
      result
    end
169454
def _kml_default_colors(x):
    
    x = max([x, 0])
    colors_arr = [simplekml.Color.red, simplekml.Color.green, simplekml.Color.blue,
                  simplekml.Color.violet, simplekml.Color.yellow, simplekml.Color.orange,
                  simplekml.Color.burlywood, simplekml.Color.azure, simplekml.Color.lightblue,
                  simplekml.Color.lawngreen, simplekml.Color.indianred, simplekml.Color.hotpink]
    return colors_arr[x]
386284
def viewport(self) -> Tuple[int, int, int, int]:
        '''
            
        '''

        return self.wnd.viewport
1332352
def rgba_floats_tuple(self, x):
        
        if x <= self.index[0]:
            return self.colors[0]
        if x >= self.index[-1]:
            return self.colors[-1]

        i = len([u for u in self.index if u < x])  # 0 < i < n.
        return tuple(self.colors[i-1])