/** * Gets a new {@link Color} based on the hexadecimal value * for a combined {@code red}, {@code green}, and {@code blue} * color. Note that colors do not utilize an alpha modifier * * @param red The red value * @param green The green value * @param blue The blue value * @return The color object */ public static Color ofRgb(int red, int green, int blue) { return new Color(red, green, blue); }
/** * Converts the provided {@link java.awt.Color} object into a valid * {@link Color} object to be used throughout the API. * * @param color The java color object * @return The converted color object */ public static Color of(java.awt.Color color) { return new Color(color.getRed(), color.getGreen(), color.getBlue()); }
/** * converts the provided {@link Vector3f} into a {@link Color} object. * * @param vector3f The vector of three floats representing color * @return The color object */ public static Color of(Vector3f vector3f) { return new Color(Math.round(vector3f.getX()), Math.round(vector3f.getY()), Math.round(vector3f.getZ())); }
/** * converts the provided {@link Vector3d} into a {@link Color} object. * * @param vector3d The vector of three doubles representing color * @return The color object */ public static Color of(Vector3d vector3d) { return new Color((int) Math.round(vector3d.getX()), (int) Math.round(vector3d.getY()), (int) Math.round(vector3d.getZ())); }
/** * Converts the provided {@link Vector3i} into a {@link Color} object. * * @param vector3i The vector of three integers representing color * @return The color object */ public static Color of(Vector3i vector3i) { return new Color(vector3i.getX(), vector3i.getY(), vector3i.getZ()); }
public static Color ofRgb(int red, int green, int blue) { return new Color(red, green, blue); }
public static Color of(java.awt.Color color) { return new Color(color.getRed(), color.getGreen(), color.getBlue()); }
public static Color of(Vector3f vector3f) { return new Color(Math.round(vector3f.getX()), Math.round(vector3f.getY()), Math.round(vector3f.getZ())); }
public static Color of(Vector3d vector3d) { return new Color((int) Math.round(vector3d.getX()), (int) Math.round(vector3d.getY()), (int) Math.round(vector3d.getZ())); }
public static Color of(Vector3i vector3i) { return new Color(vector3i.getX(), vector3i.getY(), vector3i.getZ()); }