문제

From what I'm reading it's possible to write JavaFX2 skins via CSS. But I can't seem to find any complete examples of this, a few tutorials here and there, but that's it. Specifically I'm looking for a "dark" skin for JavaFX2. Any ideas of where to find pre-made skins?

도움이 되었습니까?

해결책

If you read modena.css you'll see an explanation where colors values are derived from

 * -fx-text-base-color for text on top of -fx-base, -fx-color, and -fx-body-color
 * -fx-text-background-color for text on top of -fx-background
 * -fx-text-inner-color for text on top of -fx-control-inner-color
 * -fx-selection-bar-text for text on top of -fx-selection-bar

You can just add some css to .root to override the base colors, here's some of theirs.

.root {
-fx-base: #ececec;
-fx-background: derive(-fx-base,26.4%);
-fx-color: -fx-base;
-fx-text-base-color: ladder(
    -fx-color,
    -fx-light-text-color 45%,
    -fx-dark-text-color  46%,
    -fx-dark-text-color  59%,
    -fx-mid-text-color   60%
);
-fx-background-color: -fx-background;

Just doing .root{-fx-base:#000000;} makes a readable dark theme that could use some tweaking.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top