/** * Returns true when the given string is from format: #ffff and false when #ffffffff. * * @param color the color string * @return true or false */ private boolean isShortMode(final String color) { return ColorValidator.isShortMode(color) || ColorValidator.isShortModeWithoutAlpha(color); }
public static boolean check(final String color) { if (ColorValidator.isShortModeWithoutAlpha(color) || ColorValidator.isLongModeWithoutAlpha(color) || ColorValidator.isValid(color)) { return true; } return false; }
public void fromString(@Nonnull final String color) { colorString = color; if (ColorValidator.isShortModeWithoutAlpha(color)) { red = getRFromString(color); green = getGFromString(color);
public void fromStringWithoutAlpha(@Nonnull final String color) { colorString = color + toHex(alpha); if (ColorValidator.isShortModeWithoutAlpha(color)) { red = getRFromString(color); green = getGFromString(color); blue = getBFromString(color); } else if (ColorValidator.isLongModeWithoutAlpha(color)) { red = getRFromString(color); green = getGFromString(color); blue = getBFromString(color); } else if (ColorValidator.isValid(color)) { red = getRFromString(color); green = getGFromString(color); blue = getBFromString(color); } else { red = green = blue = 1.0f; } }