import java.lang.reflect.Field;
import javafx.scene.paint.Color;

/**
 * Displays all named Color constants and their RGB values.
 *
 * @author Drue Coles
 */
public class JavaFXColors {

    public static void main(String[] args)
            throws ClassNotFoundException, IllegalAccessException {

        Class colorClass = Class.forName("javafx.scene.paint.Color");
        for (Field field : colorClass.getFields()) {
            Object obj = field.get(null);
            if (obj instanceof Color) {
                String s = ((Color) obj).toString();
                int r = Integer.parseInt(s.substring(2, 4), 16);
                int g = Integer.parseInt(s.substring(4, 6), 16);
                int b = Integer.parseInt(s.substring(6, 8), 16);
                System.out.printf("%s %d %d %d%n", field.getName(), r, g, b);
            } 
        }
    }
}