/** * helper to get alpha from a string value. * * @param color color string * @return alpha value */ private float getAFromString(@Nonnull final String color) { if (isShortMode(color)) { return (Integer.valueOf(color.substring(1, 2), HEX_BASE) * SCALE_SHORT_MODE) / MAX_INT_VALUE; } else { return Integer.valueOf(color.substring(1, 3), HEX_BASE) / MAX_INT_VALUE; } }