Function useColorsAndLocations

  • Ensures that the colors and locations arrays have the same length. If one array is shorter, it is padded with default values to match the length of the longer array. The locations array is ensured to end with a 1 if it's shorter.

    Parameters

    Returns {
        colors: string[];
        locations: number[];
    }

    An object with colors and locations arrays of equal length.

    • colors: string[]
    • locations: number[]