File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/main/java/de/bluecolored/bluemap/api/math Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -128,15 +128,16 @@ public float getAlpha() {
128128 return a ;
129129 }
130130
131- private static int parseColorString (String val ) {
131+ private static int parseColorString (String value ) {
132+ String val = value ;
132133 if (val .charAt (0 ) == '#' ) {
133134 val = val .substring (1 );
134135 if (val .length () == 3 ) val = val + "f" ;
135136 if (val .length () == 4 ) val = "" +
136137 val .charAt (0 ) + val .charAt (0 ) + val .charAt (1 ) + val .charAt (1 ) +
137138 val .charAt (2 ) + val .charAt (2 ) + val .charAt (3 ) + val .charAt (3 );
138139 if (val .length () == 6 ) val = val + "ff" ;
139- if (val .length () != 8 ) throw new NumberFormatException ("Invalid color format: '" + val + "'!" );
140+ if (val .length () != 8 ) throw new NumberFormatException ("Invalid color format: '" + value + "'!" );
140141 val = val .substring (6 , 8 ) + val .substring (0 , 6 ); // move alpha to front
141142 return Integer .parseUnsignedInt (val , 16 );
142143 }
You can’t perform that action at this time.
0 commit comments