Changeset 562
- Timestamp:
- 12/03/13 09:48:42 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/io/Conversion.java
r476 r562 90 90 91 91 private static Color getRGBColor(String colorCode, Color current) { 92 int color[] = new int[ 3];92 int color[] = new int[4]; 93 93 // Assert.assertTrue(color.length == 3); 94 94 … … 102 102 String g = values.length > 1 ? values[1] : "0"; 103 103 String b = values.length > 2 ? values[2] : "0"; 104 String a = values.length > 3 ? values[3] : "100"; 104 105 105 106 int red = (current == null ? 0 : toColorPercent(current.getRed())); 106 int green = (current == null ? 0 : toColorPercent(current 107 .getGreen())); 107 int green = (current == null ? 0 : toColorPercent(current.getGreen())); 108 108 int blue = (current == null ? 0 : toColorPercent(current.getBlue())); 109 int alpha = (current == null ? 0 : toColorPercent(current.getAlpha())); 110 109 111 color[0] = (Integer) Convert(int.class, r, red); 110 112 color[1] = (Integer) Convert(int.class, g, green); 111 113 color[2] = (Integer) Convert(int.class, b, blue); 114 color[3] = (Integer) Convert(int.class, a, alpha); 112 115 113 116 for (int i = 0; i < color.length; i++) { 114 117 color[i] = toRGB(color[i]); 115 118 } 116 return new Color(color[0], color[1], color[2] );119 return new Color(color[0], color[1], color[2], color[3]); 117 120 } catch (Exception e) { 118 121 return null; … … 161 164 int g = (int) Math.round((color.getGreen() / RGB_CONVERSION_FACTOR)); 162 165 int b = (int) Math.round((color.getBlue() / RGB_CONVERSION_FACTOR)); 163 164 return r + " " + g + " " + b; 166 int a = (int) Math.round((color.getAlpha() / RGB_CONVERSION_FACTOR)); 167 168 return r + " " + g + " " + b + " " + a; 165 169 } 166 170
Note:
See TracChangeset
for help on using the changeset viewer.