-
Enhancement
-
Resolution: Unresolved
-
P4
-
8u92
-
x86
-
other
A DESCRIPTION OF THE REQUEST :
Converting AWT Colors to JavaFX Paint.Color values requires a bit of boilerplate. JavaFX has no equivalent of java.awt.SystemColor which could be used to implement native styles. The addition of a helper function to convert AWT colors and a new SystemColor API for JavaFX would solve these problems.
JUSTIFICATION :
For any progress to be made onJDK-8129408 or JDK-8090700 it will be necessary to have access to the native OS color palettes as JavaFX Paint Colors.
CUSTOMER SUBMITTED WORKAROUND :
From StackOverflow:
http://stackoverflow.com/questions/30466405/java-convert-java-awt-color-to-javafx-scene-paint-color
java.awt.Color awtColor = ... ;
int r = awtColor.getRed();
int g = awtColor.getGreen();
int b = awtColor.getBlue();
int a = awtColor.getAlpha();
double opacity = a / 255.0;
javafx.scene.paint.Color fxColor = javafx.scene.paint.Color.rgb(r, g, b, opacity);
Converting AWT Colors to JavaFX Paint.Color values requires a bit of boilerplate. JavaFX has no equivalent of java.awt.SystemColor which could be used to implement native styles. The addition of a helper function to convert AWT colors and a new SystemColor API for JavaFX would solve these problems.
JUSTIFICATION :
For any progress to be made on
CUSTOMER SUBMITTED WORKAROUND :
From StackOverflow:
http://stackoverflow.com/questions/30466405/java-convert-java-awt-color-to-javafx-scene-paint-color
java.awt.Color awtColor = ... ;
int r = awtColor.getRed();
int g = awtColor.getGreen();
int b = awtColor.getBlue();
int a = awtColor.getAlpha();
double opacity = a / 255.0;
javafx.scene.paint.Color fxColor = javafx.scene.paint.Color.rgb(r, g, b, opacity);