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

Certain blend modes cannot be set from CSS

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      os_x

      Description

      A DESCRIPTION OF THE PROBLEM :
      Blend modes "add", "red", "green" and "blue" cannot be set via CSS (-fx-blend-mode: red) I assume because they get parsed as colors and not blend mode enum values. (add becomes 0xaadddd most likely?)

      Warning that gets logged:

      ```
      Sep 29, 2021 10:13:55 AM javafx.scene.CssStyleHelper calculateValue
      WARNING: Caught 'java.lang.ClassCastException: class javafx.scene.paint.Color cannot be cast to class java.lang.String (javafx.scene.paint.Color is in module javafx.graphics@11.0.12 of loader 'platform'; java.lang.String is in module java.base of loader 'bootstrap')' while converting value for '-fx-blend-mode' from inline style on Label@1b4e2356[styleClass=label rainbow blend-test]'add'
      ```

      Additionally, `src-atop` and all the other `src-*` blend modes referenced in the documentation here seemingly cannot be set at all: https://openjfx.io/javadoc/11/javafx.graphics/javafx/scene/doc-files/cssref.html

      In the source code the blend modes `src-*` are only referenced in the documentation based on this search: https://github.com/openjdk/jfx/search?q=src-atop (Maybe it should just be removed?)


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mhanl Marius Hanl
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: