Conversion helper for AWT Color to JavaFX Paint/SystemColor Palettes

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 8u92
    • Component/s: javafx

      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 on JDK-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);

            Assignee:
            Unassigned
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: