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

Certain blend modes cannot be set from CSS

XMLWordPrintable

    • x86_64
    • os_x

      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?)


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

              Created:
              Updated:
              Resolved: