Skip to content

Instantly share code, notes, and snippets.

@team172011
Created January 5, 2018 10:29
Show Gist options
  • Save team172011/8ef8de020d146fa6c37bf311d26e01ec to your computer and use it in GitHub Desktop.
Save team172011/8ef8de020d146fa6c37bf311d26e01ec to your computer and use it in GitHub Desktop.
java.awt.Color to javafx.scene.paint.Color
import java.awt.Color;
/**
* Returns a javaFX Color object that represents the same color as the awt color object
* @param c a java.awt.Color object
*/
private javafx.scene.paint.Color awtColorToJavaFX(Color c) {
return javafx.scene.paint.Color.rgb(c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha() / 255.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment