Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8102360

Introduce a color-function to change the alpha-value of a CSS-color

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7u6
    • javafx
    • None

      The FX-CSS guide lists two color-functions[1], "derive" and "ladder" and reasons that the help to "[enable] a color theme to be specified using a single base color and to have variant colors computed from that base color."

      In that vein, I would like to propose a sister-function to "derive":
      Called "transparent", it takes a color and a percentage as its argument and returns the base color with its alpha value set to the percentage.

      transparent(red, 0.5) creates semi-translucent red
      transparent(#00ff00, 0.25), creates a faint green

      A function like this would help to further reuse in fx-css and thus help to achieve a color scheme based on few base-colors.

      [1] http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#typecolor

            dgrieve David Grieve
            ureupkejfx Urs Reupke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: