Change part of the color of CharSequence.

@param content content text.
@param start   start index.
@param end     end index.
@param color   color.
@return {@code SpannableString}.
439839
@NonNull
    public static SpannableString getColorText(@NonNull CharSequence content, int start, int end, @ColorInt int color) {
        SpannableString stringSpan = new SpannableString(content);
        stringSpan.setSpan(new ForegroundColorSpan(color), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        return stringSpan;
    }
522042
public void setPrimaryButtonTextHoverColor(String color) throws HelloSignException {
        if (white_labeling_options == null) {
            white_labeling_options = new WhiteLabelingOptions();
        }
        white_labeling_options.setPrimaryButtonTextHoverColor(color);
    }
530390
protected void parse( String content ) {
        Tokenizer tokenizer = new CndTokenizer(false, true);
        TokenStream tokens = new TokenStream(content, tokenizer, false);
        tokens.start();
        while (tokens.hasNext()) {
            // Keep reading while we can recognize one of the two types of statements ...
            if (tokens.matches("<", ANY_VALUE, "=", ANY_VALUE, ">")) {
                parseNamespaceMapping(tokens);
            } else if (tokens.matches("[", ANY_VALUE, "]")) {
                parseNodeTypeDefinition(tokens);
            } else {
                Position position = tokens.previousPosition();
                throw new ParsingException(position, CndI18n.expectedNamespaceOrNodeDefinition.text(tokens.consume(),
                                                                                                    position.getLine(),
                                                                                                    position.getColumn()));
            }
        }
    }
855249
public final void removeHelperTextColor(@ColorInt final int color) {
        int index = helperTextColors.indexOf(color);

        if (index != -1) {
            helperTextColors.remove(index);
            verifyPasswordStrength();
        }
    }
485818
public void setThumbColor(int startColor, int endColor) {
        mSeekBarDrawable.setThumbColor(ColorStateList.valueOf(startColor));
        if (mIndicator != null)
            mIndicator.setColors(startColor, endColor);
    }
531599
public static String clearColor(String orgString, int color) {
        return orgString.replace("<font color=\"" + colorToHexString(color) + "\">", "").replace("</font>", "");
    }
994959
public static void setPreferredColor(int color) {
		final Preferences prefs = Preferences.userNodeForPackage(MapElementConstants.class);
		if (prefs != null) {
			prefs.putInt("COLOR", color); //$NON-NLS-1$
			try {
				prefs.flush();
			} catch (BackingStoreException exception) {
				//
			}
		}
	}
903240
@CheckReturnValue
    public RoleAction setColor(Color color)
    {
        return this.setColor(color != null ? color.getRGB() : null);
    }
603250
public void setAutoTextColor(final boolean AUTOMATIC) {
        if (null == autoTextColor) {
            _autoTextColor = AUTOMATIC;
            adjustTextColors();
            redraw();
        } else {
            autoTextColor.set(AUTOMATIC);
        }
    }
608687
private static Color getColor(String colorString) {

		Color color = null;

		String[] colorParts = colorString.split(",");

		try {

			switch (colorParts.length) {

			case 1:
				Field field = Color.class.getField(colorString);
				color = (Color) field.get(null);
				break;

			case 3:
				color = new Color(Integer.parseInt(colorParts[0]),
						Integer.parseInt(colorParts[1]),
						Integer.parseInt(colorParts[2]));
				break;

			case 4:
				color = new Color(Integer.parseInt(colorParts[0]),
						Integer.parseInt(colorParts[1]),
						Integer.parseInt(colorParts[2]),
						Integer.parseInt(colorParts[3]));
				break;

			default:
				throw new GeoPackageException("Unexpected color arguments: "
						+ colorParts.length + ", color: " + colorString);
			}

		} catch (Exception e) {
			throw new GeoPackageException("Invalid color: " + colorString
					+ ", Allowable Formats: colorName | r,g,b | r,g,b,a", e);
		}

		return color;
	}
1109009
public void setTextColor2(String color) throws HelloSignException {
        if (white_labeling_options == null) {
            white_labeling_options = new WhiteLabelingOptions();
        }
        white_labeling_options.setTextColor2(color);
    }
1080860
@Nonnull
  public FontSpec getCloneWithDifferentColor (@Nonnull final Color aNewColor)
  {
    ValueEnforcer.notNull (aNewColor, "NewColor");
    if (aNewColor.equals (m_aColor))
      return this;
    return new FontSpec (m_aPreloadFont, m_fFontSize, aNewColor);
  }
396063
public function colorize(string $startColor, string $text, string $endColor = self::NORMAL): string
    {
        if ($this->getEnableColoredOutput()) {
            return $startColor . $text . $endColor;
        }

        return $text;
    }
1267157
def color(text, color=None, background=None, light=False, enabled="auto"):
    
    colors = {"black": 30, "red": 31, "green": 32, "yellow": 33,
              "blue": 34, "magenta": 35, "cyan": 36, "white": 37}
    # Nothing do do if coloring disabled
    if enabled == "auto":
        enabled = Coloring().enabled()
    if not enabled:
        return text
    # Prepare colors (strip 'light' if present in color)
    if color and color.startswith("light"):
        light = True
        color = color[5:]
    color = color and ";{0}".format(colors[color]) or ""
    background = background and ";{0}".format(colors[background] + 10) or ""
    light = light and 1 or 0
    # Starting and finishing sequence
    start = "\033[{0}{1}{2}m".format(light, color, background)
    finish = "\033[1;m"
    return "".join([start, text, finish])
214647
public static Color toColor(final String colorString) {
        String trimmedString = colorString.trim();
        Color color = null;
        if (trimmedString.startsWith("#")) {
            final int shortHexCode = 4;
            if (trimmedString.length() == shortHexCode) {
                StringBuilder builder = new StringBuilder("#");
                for (int i = 1; i < trimmedString.length(); i++) {
                    builder.append(trimmedString.charAt(i));
                    builder.append(trimmedString.charAt(i));
                }
                color = SLD.toColor(builder.toString());
            } else {
                color = SLD.toColor(trimmedString);
            }
        }

        if (color == null) {
            color = parseRgbColor(trimmedString);
        }

        if (color == null) {
            color = parseRgbaColor(trimmedString);
        }

        if (color == null) {
            color = parseHslColor(trimmedString);
        }

        if (color == null) {
            color = parseHslaColor(trimmedString);
        }

        if (color == null) {
            final Field[] fields = Color.class.getFields();
            for (Field field: fields) {
                if (field.getType() == Color.class && Modifier.isFinal(field.getModifiers())
                        && Modifier.isStatic(field.getModifiers()) &&
                        field.getName().equalsIgnoreCase(trimmedString)) {
                    try {
                        return (Color) field.get(null);
                    } catch (IllegalAccessException e) {
                        throw new Error(e);
                    }
                }
            }
            color = Color.decode(trimmedString);
        }

        return color;
    }
860755
public void setTextColor(final Color COLOR) {
        if (null == textColor) {
            _textColor = COLOR;
            redraw();
        } else {
            textColor.set(COLOR);
        }
    }
750585
public final void addHelperTextColor(@ColorInt final int color) {
        if (!helperTextColors.contains(color)) {
            helperTextColors.add(color);
            verifyPasswordStrength();
        }
    }