(String colorText, boolean isFill)
| 1268 | |
| 1269 | |
| 1270 | void setColor(String colorText, boolean isFill) { |
| 1271 | colorText = colorText.trim(); |
| 1272 | int opacityMask = fillColor & 0xFF000000; |
| 1273 | boolean visible = true; |
| 1274 | int color = 0; |
| 1275 | String name = ""; |
| 1276 | // String lColorText = colorText.toLowerCase(); |
| 1277 | Gradient gradient = null; |
| 1278 | // Object paint = null; |
| 1279 | if (colorText.equals("none")) { |
| 1280 | visible = false; |
| 1281 | } else if (colorText.startsWith("url(#")) { |
| 1282 | name = colorText.substring(5, colorText.length() - 1); |
| 1283 | Object object = findChild(name); |
| 1284 | if (object instanceof Gradient) { |
| 1285 | gradient = (Gradient) object; |
| 1286 | // in 3.0a11, do this on first draw inside PShapeJava2D |
| 1287 | // paint = calcGradientPaint(gradient); //, opacity); |
| 1288 | } else { |
| 1289 | // visible = false; |
| 1290 | System.err.println("url " + name + " refers to unexpected data: " + object); |
| 1291 | } |
| 1292 | } else { |
| 1293 | // Prints errors itself. |
| 1294 | color = opacityMask | parseSimpleColor(colorText); |
| 1295 | } |
| 1296 | if (isFill) { |
| 1297 | fill = visible; |
| 1298 | fillColor = color; |
| 1299 | fillName = name; |
| 1300 | fillGradient = gradient; |
| 1301 | // fillGradientPaint = paint; |
| 1302 | } else { |
| 1303 | stroke = visible; |
| 1304 | strokeColor = color; |
| 1305 | strokeName = name; |
| 1306 | strokeGradient = gradient; |
| 1307 | // strokeGradientPaint = paint; |
| 1308 | } |
| 1309 | } |
| 1310 | |
| 1311 | |
| 1312 | /** |
no test coverage detected