Java tutorial
//package com.java2s; //License from project: Open Source License import javafx.scene.paint.Color; public class Main { public static Color fromAwt(final java.awt.Color color) { if (null == color) { return null; } if (color.getAlpha() >= 255) { return Color.color(color.getRed() / 255d, color.getGreen() / 255d, color.getBlue() / 255d); } else { return Color.color(color.getRed() / 255d, color.getGreen() / 255d, color.getBlue() / 255d, color.getAlpha() / 255d); } } }