Append a string with the given color (normal Color or an
        AbstractColor).
516470
def append(self, p_string, p_color):
        
        self.colors[len(self.data)] = p_color
        self.data += p_string
936797
def _buf_append(self, string):
        ''''''
        if not self._buf:
            self._buf = string
        else:
            self._buf += string
679388
public String _append(String str) {
	if (offset + size + 1 > arr.length) enlargeCapacity(size + 1);
	arr[offset + size] = str;
	size++;
	return str;
    }
382144
public static String encode(Color color) {
        StringBuffer buffer = new StringBuffer("#");
        if (color.getRed() < 16) {
            buffer.append('0');
        }
        buffer.append(Integer.toString(color.getRed(), 16));
        if (color.getGreen() < 16) {
            buffer.append('0');
        }
        buffer.append(Integer.toString(color.getGreen(), 16));
        if (color.getBlue() < 16) {
            buffer.append('0');
        }
        buffer.append(Integer.toString(color.getBlue(), 16));
        return buffer.toString();
    }
830023
public SnackbarBuilder appendMessage(CharSequence message, @ColorInt int color) {
    initialiseAppendMessages();
    Spannable spannable = new SpannableString(message);
    spannable.setSpan(new ForegroundColorSpan(color), 0, spannable.length(),
        Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    appendMessages.append(spannable);
    return this;
  }
249107
def color(string, name, style='normal', when='auto'):
    
    if name not in colors:
        from .text import oxford_comma
        raise ValueError("unknown color '{}'.\nknown colors are: {}".format(
            name, oxford_comma(["'{}'".format(x) for x in sorted(colors)])))

    if style not in styles:
        from .text import oxford_comma
        raise ValueError("unknown style '{}'.\nknown styles are: {}".format(
            style, oxford_comma(["'{}'".format(x) for x in sorted(styles)])))

    prefix = '\033[%d;%dm' % (styles[style], colors[name])
    suffix = '\033[%d;%dm' % (styles['normal'], colors['normal'])
    color_string = prefix + string + suffix

    if when == 'always':
        return color_string
    elif when == 'auto':
        return color_string if sys.stdout.isatty() else string
    elif when == 'never':
        return string
    else:
        raise ValueError("when must be one of: 'always', 'auto', 'never'")
173132
def bgblue(cls, string, auto=False):
        
        return cls.colorize('bgblue', string, auto=auto)
702558
function colorString(value) {
  const asColor = color(value);
  const r = asColor.r.toString(16);
  const g = asColor.g.toString(16);
  const b = asColor.b.toString(16);

  return `#${r.length === 1 ? '0' : ''}${r}${g.length === 1 ? '0' : ''}${g}${b.length === 1 ? '0' : ''}${b}`;
}
715237
protected String colorString(int ir, int ig, int ib)
    {
    	return String.format("#%02x%02x%02x", ir, ig, ib);
    }
1088603
def update_color(string, name, style='normal', when='auto'):
    
    clear()
    write_color(string, name, style, when)
497002
def _wrap_with(color_code):
    '''
    '''
    def inner(text, bold=False):
        '''Inner color function.'''
        code = color_code
        if bold:
            code = flo("1;{code}")
        return flo('\033[{code}m{text}\033[0m')
    return inner
239415
@NonNull
  @SuppressWarnings("WeakerAccess")
  public SnackbarWrapper appendMessage(@StringRes int message,
                                       @ColorRes int color) {
    return appendMessage(context.getString(message),
        ContextCompat.getColor(context, color));
  }
1016409
def _write_color_ansi (fp, text, color):
    """"""
    fp.write(esc_ansicolor(color))
    fp.write(text)
    fp.write(AnsiReset)
920050
def formatcolor(string, fg=None, bg=None):
    
    if fg is bg is None:
        return string

    temp = (['fg='+fg] if fg else []) +\
           (['bg='+bg] if bg else [])
    fmt = _color_format_parser._COLOR_DELIM.join(temp)

    return _color_format_parser._START_TOKEN + fmt +\
        _color_format_parser._FMT_TOKEN + string +\
        _color_format_parser._STOP_TOKEN
82625
function colorize(color, str) {
  return str
      .split('\n')
      .map(part => color(part))
      .join('\n');
}
714588
public static String toColor(String red, String green, String blue) {
		return toColorWithAlpha(red, green, blue, null);
	}
1252922
def _make_color_fn(color):
	""""""
	def _color(text = ""):
		return (_color_sep + color + _color_sep2 + text +
			_color_sep + "default" + _color_sep2)
	return _color