Update this label.

        :param str name: (required), new name of the label
        :param str color: (required), color code, e.g., 626262, no leading '#'
        :returns: bool
323142
def update(self, name, color):
        
        json = None

        if name and color:
            if color[0] == '#':
                color = color[1:]
            json = self._json(self._patch(self._api, data=dumps({
                'name': name, 'color': color})), 200)

        if json:
            self._update_(json)
            return True

        return False
483681
def update(self, pbar):
        
        if pbar.label != self._label:
            self.label = pbar.label

        return self.label
1114574
def colourize(str)
     ''.tap { |res| Tokenizer.tokenize(str.to_s) { |token, value|
        res << colourize_string(value, colours[token])
      } }
    rescue => err
      Brice.error(self, __method__, err)
      str
    end
1227363
def AddLabel(self, label):
    
    if not isinstance(label, py2to3.STRING_TYPES):
      raise TypeError('label is not a string type. Is {0:s}'.format(
          type(label)))
    if not self._VALID_LABEL_REGEX.match(label):
      raise ValueError((
          'Unsupported label: "{0:s}". A label must only consist of '
          'alphanumeric characters or underscores.').format(label))

    if label not in self.labels:
      self.labels.append(label)
1355853
def add(self, label):
        
        self._labels[label.id] = label
        self._dirty = True
765336
def __set_labels(self, labels):
        
        with self.fs.open(self.fs.join(self.path, self.LABEL_FILE), 'w') \
                as file_desc:
            for label in labels:
                file_desc.write("%s,%s\n" % (label.name,
                                             label.get_color_str()))
1301263
def color_func(func_name):
    
    if str(func_name).isdigit():
        return term_color(int(func_name))
    return globals()[func_name]
1115590
def write_color(writer, name, value) #:nodoc:
      attributes = [[name, value]]

      writer.empty_tag('color', attributes)
    end
1373275
static void tag(StringBuilder sb, String color, String text) {
        sb.append("<span class='label label");
        if (color != null) {
            sb.append("-").append(color);
        }
        String classText = text.replace(' ', '_');
        sb.append(" l-").append(classText).append("'>").append(text).append("</span>");
    }
1165935
def editlabel(self, project_id, name, new_name=None, color=None):
        
        data = {'name': name, 'new_name': new_name, 'color': color}

        request = requests.put(
            '{0}/{1}/labels'.format(self.projects_url, project_id), data=data,
            verify=self.verify_ssl, auth=self.auth, headers=self.headers, timeout=self.timeout)

        if request.status_code == 200:
            return request.json()
        else:
            return False
214436
def get_color_names(self, format_string):
        
        names = set()
        # Tokenize the format string and process them
        for token in self.tokens(format_string):
            if token.group("command"):
                name = dict(parse_qsl(token.group("command"))).get("color")
                if (
                    not name
                    or name in COLOR_NAMES_EXCLUDED
                    or name in COLOR_NAMES
                    or name[0] == "#"
                ):
                    continue
                names.add(name)
        return names
94682
def name(self, name):
        
        if name is None:
            raise ValueError("Invalid value for `name`, must not be `None`")
        if name is not None and len(name) > 128:
            raise ValueError("Invalid value for `name`, length must be less than or equal to `128`")
        if name is not None and len(name) < 1:
            raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`")
        if name is not None and not re.search('^[^\/]+$', name):
            raise ValueError("Invalid value for `name`, must be a follow pattern or equal to `/^[^\/]+$/`")

        self._name = name
555348
def updateDisplayLabel(self, value=None):
        """"""
        if value is None:
            value = self.param.value()
        opts = self.param.opts
        if isinstance(self.widget, QtWidgets.QAbstractSpinBox):
            text = asUnicode(self.widget.lineEdit().text())
        elif isinstance(self.widget, QtWidgets.QComboBox):
            text = self.widget.currentText()
        else:
            text = asUnicode(value)
        self.displayLabel.setText(text)
201865
def set_name(self, name="My Colormap"):
        
        if not type(name)==str:
            print("set_name(): Name must be a string.")
            return
        self._name = name
        return self
19764
async def _setcolor(self, *, color : discord.Colour):
        """"""
        data = self.bot.config.get("meta", {})
        data['default_color'] = str(color)
        await self.bot.config.put('meta', data)
        await self.bot.responses.basic(message="The default color has been updated.")
1133681
def progress_color(current, total, name, style='normal', when='auto'):
    
    update_color('[%d/%d] ' % (current, total), name, style, when)
369855
def getColor(name):
    
    try:
        c = getColorInfoList()[getColorList().index(name.upper())]
        return (c[1] / 255., c[2] / 255., c[3] / 255.)
    except:
        return (1, 1, 1)