Example usage for javafx.scene.paint Color getOpacity

List of usage examples for javafx.scene.paint Color getOpacity

Introduction

In this page you can find the example usage for javafx.scene.paint Color getOpacity.

Prototype

public final double getOpacity() 

Source Link

Document

The opacity of the Color , in the range 0.0-1.0 .

Usage

From source file:Main.java

public static java.awt.Color toAwt(final Color color) {
    if (null == color) {
        return null;
    }/*w w w . ja  v  a  2 s .  c  o  m*/
    if (color.isOpaque() || color.getOpacity() >= 1d) {
        return new java.awt.Color((float) color.getRed(), (float) color.getGreen(), (float) color.getBlue());
    } else {
        return new java.awt.Color((float) color.getRed(), (float) color.getGreen(), (float) color.getBlue(),
                (float) color.getOpacity());
    }
}