ps1
    Preparing search index...

    Function makePalette

    • Produce a palette of RGB colors that have the same saturation and lightness as the input and evenly divide the spectrum of hues using the HSL representation of RGB. All input and output colors are [r,g,b] tuples of integers 0 <= r,g,b <= 255. See https://en.wikipedia.org/wiki/HSL_and_HSV for an explanation of HSL and its relationship to RGB.

      For example, a palette generated from pure green (which has hue=120°, saturation=100%, lightness=50%) and n=4 would have: a bright orange (hue=30°), pure green, a dodger blue (210°), and fuchsia (300°).

      Parameters

      • color: Color

        base RGB color

      • n: number

        number of hues to select from the spectrum of hues, nonnegative integer

      Returns Color[]

      an array of exactly all the distinct RGB colors converted (and rounded, half up) from HSL colors that have:

      • hues, in degrees, that are multiples modulo 360 of 360/n degrees from the hue of color,
      • and the same saturation and lightness as color