Hex Core JS
    Preparing search index...

    Function getGradientValue

    • Returns a color value along the gradient defined by the given colors depending on the given value. Works like creating a linear gradient and picking the color at value portion of the way across.

      Providing no colors results in white (as a fallback). Providing a single color results in that color every time.

      Useful for intensity or data-related coloring.

      Parameters

      • value: number

        The value for the color.

      • ...colors: string[]

      Returns string

      Colors in the middle of two colors can often be ugly, for this reason it is recommended to supply more than two colors if those colors are far apart from each other for more control over intermediate values.