Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-10-05 21:22:10 +02:00
commit e0816e9c6d

View file

@ -219,14 +219,14 @@ public class Algorithms {
public static int parseColor(String colorString) { public static int parseColor(String colorString) {
if (colorString.charAt(0) == '#') { if (colorString.charAt(0) == '#') {
// Use a long to avoid rollovers on #ffXXXXXX // Use a long to avoid rollovers on #ffXXXXXX
long color = Long.parseLong(colorString.substring(1), 16); if (colorString.length() == 4) {
if (colorString.length() == 4) {
colorString = "#" + colorString = "#" +
colorString.charAt(1) + colorString.charAt(1) + colorString.charAt(1) + colorString.charAt(1) +
colorString.charAt(2) + colorString.charAt(2) + colorString.charAt(2) + colorString.charAt(2) +
colorString.charAt(3) + colorString.charAt(3); colorString.charAt(3) + colorString.charAt(3);
} }
long color = Long.parseLong(colorString.substring(1), 16);
if (colorString.length() == 7) { if (colorString.length() == 7) {
// Set the alpha value // Set the alpha value
color |= 0x00000000ff000000; color |= 0x00000000ff000000;