Java Code Examples for javafx.scene.paint.Color#SADDLEBROWN
The following examples show how to use
javafx.scene.paint.Color#SADDLEBROWN .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TargetEditorController.java From ShootOFF with GNU General Public License v3.0 | 5 votes |
public static Color createColor(final String name) { switch (name) { case "black": return Color.BLACK; case "blue": return Color.BLUE; case "brown": return Color.SADDLEBROWN; case "gray": return DARK_GRAY; case "green": return Color.GREEN; case "orange": return Color.ORANGE; case "red": return Color.RED; case "white": return Color.WHITE; default: if (name.startsWith("#")) { try { return Color.web(name); } catch (IllegalArgumentException e) { return Color.CORNSILK; } } else { return Color.CORNSILK; } } }
Example 2
Source File: ShipImage.java From logbook-kai with MIT License | 5 votes |
/** * 補給ゲージ(燃料・弾薬)を取得します * * @param ship 艦娘 * @return 補給ゲージ */ static Image getSupplyGauge(Ship ship) { Canvas canvas = new Canvas(36, 12); GraphicsContext gc = canvas.getGraphicsContext2D(); Optional<ShipMst> mstOpt = Ships.shipMst(ship); if (mstOpt.isPresent()) { double width = canvas.getWidth(); ShipMst mst = mstOpt.get(); double fuelPer = (double) ship.getFuel() / (double) mst.getFuelMax(); double ammoPer = (double) ship.getBull() / (double) mst.getBullMax(); gc.setFill(Color.GRAY); gc.fillRect(0, 3, width, 2); gc.setFill(Color.GRAY); gc.fillRect(0, 10, width, 2); Color fuelColor = fuelPer >= 0.5D ? Color.GREEN : fuelPer >= 0.4D ? Color.ORANGE : Color.RED; Color ammoColor = ammoPer >= 0.5D ? Color.SADDLEBROWN : ammoPer >= 0.4D ? Color.ORANGE : Color.RED; gc.setFill(fuelColor); gc.fillRect(0, 0, width * fuelPer, 4); gc.setFill(ammoColor); gc.fillRect(0, 7, width * ammoPer, 4); } SnapshotParameters sp = new SnapshotParameters(); sp.setFill(Color.TRANSPARENT); return canvas.snapshot(sp, null); }
Example 3
Source File: EpidemicReportsSettingsController.java From MyBox with Apache License 2.0 | 4 votes |
@FXML public void defaultValuesColors() { Color color = Color.BLUE; confirmedRect.setFill(color); FxmlControl.setTooltip(confirmedRect, new Tooltip(FxmlColor.colorNameDisplay(color))); color = Color.RED; healedRect.setFill(color); FxmlControl.setTooltip(healedRect, new Tooltip(FxmlColor.colorNameDisplay(color))); color = Color.BLACK; deadRect.setFill(color); FxmlControl.setTooltip(deadRect, new Tooltip(FxmlColor.colorNameDisplay(color))); color = Color.SLATEBLUE; IncreasedConfirmedRect.setFill(color); FxmlControl.setTooltip(IncreasedConfirmedRect, new Tooltip(FxmlColor.colorNameDisplay(color))); color = Color.HOTPINK; IncreasedHealedRect.setFill(color); FxmlControl.setTooltip(IncreasedHealedRect, new Tooltip(FxmlColor.colorNameDisplay(color))); color = Color.GRAY; IncreasedDeadRect.setFill(color); FxmlControl.setTooltip(IncreasedDeadRect, new Tooltip(FxmlColor.colorNameDisplay(color))); color = Color.PALEGREEN; HealedConfirmedPermillageRect.setFill(color); FxmlControl.setTooltip(HealedConfirmedPermillageRect, new Tooltip(FxmlColor.colorNameDisplay(color))); color = Color.STEELBLUE; DeadConfirmedPermillageRect.setFill(color); FxmlControl.setTooltip(DeadConfirmedPermillageRect, new Tooltip(FxmlColor.colorNameDisplay(color))); color = Color.MEDIUMPURPLE; ConfirmedPopulationPermillageRect.setFill(color); FxmlControl.setTooltip(ConfirmedPopulationPermillageRect, new Tooltip(FxmlColor.colorNameDisplay(color))); color = Color.SADDLEBROWN; DeadPopulationPermillageRect.setFill(color); FxmlControl.setTooltip(DeadPopulationPermillageRect, new Tooltip(FxmlColor.colorNameDisplay(color))); color = Color.LIGHTPINK; HealedPopulationPermillageRect.setFill(color); FxmlControl.setTooltip(HealedPopulationPermillageRect, new Tooltip(FxmlColor.colorNameDisplay(color))); color = Color.BLUEVIOLET; ConfirmedAreaPermillageRect.setFill(color); FxmlControl.setTooltip(ConfirmedAreaPermillageRect, new Tooltip(FxmlColor.colorNameDisplay(color))); color = Color.MEDIUMVIOLETRED; HealedAreaPermillageRect.setFill(color); FxmlControl.setTooltip(HealedAreaPermillageRect, new Tooltip(FxmlColor.colorNameDisplay(color))); color = Color.SILVER; DeadAreaPermillageRect.setFill(color); FxmlControl.setTooltip(DeadAreaPermillageRect, new Tooltip(FxmlColor.colorNameDisplay(color))); }