| Constructor and Description |
|---|
Color(int red,
int green,
int blue)
It creates a color object from a RGB format (red, green, blue).
|
Color(String hexform)
It creates a color object from a String representation (CSS Style).
|
public Color(int red,
int green,
int blue)
red - the red color intensity. It must be in a 0-255 rangegreen - the green color intensity. It must be in a 0-255 rangeblue - the blue color intensity. It must be in a 0-255 rangepublic Color(String hexform)
hexform - The string representation of the color. For example: "#A24C21"IllegalArgumentException - if the string hasn't 7 characters or is ill-formedpublic int getRed()
public int getBlue()
public int getGreen()
public String toString()
public Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionCopyright © 2026. All rights reserved.