Commit 9ab6c961 by Oliver Woodman

Make TtmlColorParser comment a little clearer.

parent c60dac7c
...@@ -88,7 +88,7 @@ import java.util.regex.Pattern; ...@@ -88,7 +88,7 @@ import java.util.regex.Pattern;
Assertions.checkArgument(!TextUtils.isEmpty(colorExpression)); Assertions.checkArgument(!TextUtils.isEmpty(colorExpression));
colorExpression = colorExpression.replace(" ", ""); colorExpression = colorExpression.replace(" ", "");
if (colorExpression.charAt(0) == '#') { if (colorExpression.charAt(0) == '#') {
// Parse using Long to avoid failure when the unsigned value exceeds (2^31 - 1). // Parse using Long to avoid failure when colorExpression is greater than #7FFFFFFF.
int color = (int) Long.parseLong(colorExpression.substring(1), 16); int color = (int) Long.parseLong(colorExpression.substring(1), 16);
if (colorExpression.length() == 7) { if (colorExpression.length() == 7) {
// Set the alpha value // Set the alpha value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment