Class Palette


  • public final class Palette
    extends Object
    Provides methods for generating color palettes based on various color harmony principles, employing the HSB color space and producing colors as sRGB integers. The palettes can be used for creating gradients and other color-related visual elements.
    Author:
    Michael Carleton
    • Constructor Summary

      Constructors 
      Constructor Description
      Palette()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int[] complementary()
      Generates a complementary color palette consisting of two colors that are diametrically opposite on the color wheel.
      static int[] randomcolors​(int ncolors)
      Generates a palette of randomly selected colors using the golden ratio for hue distribution, which tends to produce aesthetically pleasing results.
      static int[] randomRandomcolors​(int ncolors)
      Generates a palette of completely random colors without any constraints on hue distribution, saturation, or brightness.
      static int[] tetradic()
      Generates a tetradic color palette consisting of four colors that are evenly spaced around the color wheel, offering a diverse range of hues.
      static int[] triadic()
      Generates a triadic color palette consisting of three colors that are evenly spaced around the color wheel, creating a harmonious and balanced color scheme.
    • Constructor Detail

      • Palette

        public Palette()
    • Method Detail

      • complementary

        public static int[] complementary()
        Generates a complementary color palette consisting of two colors that are diametrically opposite on the color wheel.
        Returns:
        An array of two colors, represented as ARGB integers.
      • triadic

        public static int[] triadic()
        Generates a triadic color palette consisting of three colors that are evenly spaced around the color wheel, creating a harmonious and balanced color scheme.
        Returns:
        An array of three colors, represented as ARGB integers.
      • tetradic

        public static int[] tetradic()
        Generates a tetradic color palette consisting of four colors that are evenly spaced around the color wheel, offering a diverse range of hues.
        Returns:
        An array of four colors, represented as ARGB integers.
      • randomcolors

        public static int[] randomcolors​(int ncolors)
        Generates a palette of randomly selected colors using the golden ratio for hue distribution, which tends to produce aesthetically pleasing results.
        Parameters:
        ncolors - The number of random colors to generate.
        Returns:
        An array of colors, represented as ARGB integers.
      • randomRandomcolors

        public static int[] randomRandomcolors​(int ncolors)
        Generates a palette of completely random colors without any constraints on hue distribution, saturation, or brightness.
        Parameters:
        ncolors - The number of random colors to generate.
        Returns:
        An array of colors, represented as ARGB integers.
        See Also:
        For generating colors with similar saturation and brightness.