In JOGL, a figure can be filled out with different type of colors. Coloring just enhances the look and feel of figure.
To specify the type of color, JOGL uses glColor3f() method of GL2 interface. This method follows RGB (Red, Green, Blue) color model. In this model, each color is represented with a value between 0 to 1 where 0 means none of that color and 1 means maximum of that color.
Note - It is required to pass the value of all three colors as a parameter of glColor3f() method.
JOGL Color Code List
Following is the list of codes for some frequently used colors :
JOGL single coloring Example
This is a simple example where a triangle is filled out with one (green) color only.
JOGL mixed Coloring Example
In this example, a triangle is filled out with three different colors.