import java.awt.Color; public class ColorDemo { public static void main(String[] args) { Color c1 = Color.BLUE; Color c2 = c1.darker(); System.out.println(c1); // prints java.awt.Color[r=0,g=0,b=255] System.out.println(c2); // prints java.awt.Color[r=0,g=0,b=128] } }In this example, the code creates a Color object representing the color blue, and then uses the darker() method to create a new color that is half as bright as the original color. The resulting color is assigned to c2, and the original and new color are printed to the console. The package library for java.awt.Color is java.awt.