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