0

我想修改此代码并使进度条变为绿色:

.progress-bar > .bar {
    -fx-background-color: linear-gradient(
        from 0px .75em to .75em 0px,
        repeat,
        -fx-accent 0%,
        -fx-accent 49%,
        derive(-fx-accent, 30%) 50%,
        derive(-fx-accent, 30%) 99%
        );
}

如何修改代码以更改视觉布局?

4

1 回答 1

2

只需覆盖-fx-accent渐变颜色源自的颜色常数:

.progress-bar > .bar {
    -fx-accent: green;
    -fx-background-color: linear-gradient(
        from 0px .75em to .75em 0px,
        repeat,
        -fx-accent 0%,
        -fx-accent 49%,
        derive(-fx-accent, 30%) 50%,
        derive(-fx-accent, 30%) 99%
        );
}
于 2013-11-10T13:23:34.753 回答