Converts the given FX color to awt color. - Java 2D Graphics

Java examples for 2D Graphics:Color

Description

Converts the given FX color to awt color.

Demo Code


//package com.java2s;
import javafx.scene.paint.Color;

public class Main {
    /**/* w ww  .  jav  a  2s .co m*/
     * Converts the given FX color to awt color.
     * 
     * @param color - FX
     * @return color - Awt
     */
    public static java.awt.Color getAwtColor(Color color) {
        return new java.awt.Color((int) color.getRed(),
                (int) color.getGreen(), (int) color.getBlue(),
                (int) color.getOpacity());
    }
}

Related Tutorials