官术网_书友最值得收藏!

Gradients

Gradients are complex color sequences which change linearly from one to another. 

In JavaFX API, each color break is defined by the Stop class. Also, by setting coordinates, you can adjust the gradient's direction. For example, in the following code the gradient goes from black to white and from the top-left corner to the bottom-right one:

// chapter2/paint/GradientDemo.java
Rectangle rect = new Rectangle(300, 200);
Stop[] stops = new Stop[]{
new Stop(0, Color.BLACK),
new Stop(1, Color.ANTIQUEWHITE)};
LinearGradient lg1 = new LinearGradient(0, 0, 300, 200, false, CycleMethod.NO_CYCLE, stops);
rect.setFill(lg1);
主站蜘蛛池模板: 望都县| 游戏| 东辽县| 九龙城区| 新平| 宁德市| 海南省| 濮阳市| 安吉县| 松阳县| 比如县| 河源市| 上饶市| 威宁| 阳城县| 嘉峪关市| 肇源县| 水城县| 博乐市| 礼泉县| 惠来县| 仁怀市| 台北市| 镇巴县| 长海县| 康乐县| 蓝山县| 兴隆县| 辽源市| 子洲县| 宜章县| 新疆| 靖安县| 泗水县| 阜康市| 巴楚县| 苏尼特右旗| 东阿县| 略阳县| 邵武市| 乐昌市|