---
title: "ColorRamp | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Class ColorRamp`Maptiler`

#### Hierarchy

-   Array<[ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\>
    -   ColorRamp

#### Indexable

-   \[n: number\]: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
    

##### Index

### Constructors[](#constructors)

[constructor](#constructor)

### Properties[](#properties)

[\[unscopables\]](#unscopables) [length](#length) [\[species\]](#species)

### Methods[](#methods)

[\[iterator\]](#iterator) [at](#at) [clone](#clone) [concat](#concat) [copyWithin](#copywithin) [entries](#entries) [every](#every) [fill](#fill) [filter](#filter) [find](#find) [findIndex](#findindex) [findLast](#findlast) [findLastIndex](#findlastindex) [flat](#flat) [flatMap](#flatmap) [forEach](#foreach) [getBounds](#getbounds) [getCanvasStrip](#getcanvasstrip) [getColor](#getcolor) [getColorHex](#getcolorhex) [getColorRelative](#getcolorrelative) [getRawColorStops](#getrawcolorstops) [hasTransparentStart](#hastransparentstart) [includes](#includes) [indexOf](#indexof) [join](#join) [keys](#keys) [lastIndexOf](#lastindexof) [map](#map) [pop](#pop) [push](#push) [reduce](#reduce) [reduceRight](#reduceright) [resample](#resample) [reverse](#reverse) [scale](#scale) [setStops](#setstops) [shift](#shift) [slice](#slice) [some](#some) [sort](#sort) [splice](#splice) [toLocaleString](#tolocalestring) [toReversed](#toreversed) [toSorted](#tosorted) [toSpliced](#tospliced) [toString](#tostring) [transparentStart](#transparentstart) [unshift](#unshift) [values](#values) [with](#with) [from](#from) [fromArrayDefinition](#fromarraydefinition) [isArray](#isarray) [of](#of)

## Constructors[](#constructors-1)

### `Maptiler`constructor[](#constructor)

-   new ColorRamp(options?: [ColorRampOptions](https://docs.maptiler.com/sdk-js/api-reference/types/ColorRampOptions/)): ColorRamp[](#constructorcolorramp)
    
    #### Parameters
    
    -   options: [ColorRampOptions](https://docs.maptiler.com/sdk-js/api-reference/types/ColorRampOptions/) = {}
    
    #### Returns ColorRamp
    
    Overrides Array<ColorStop>.constructor
    

## Properties[](#properties-1)

### `Readonly`\[unscopables\][](#unscopables)

"\[unscopables\]": {  
    "\[iterator\]"?: boolean;  
    "\[unscopables\]"?: boolean;  
    at?: boolean;  
    concat?: boolean;  
    copyWithin?: boolean;  
    entries?: boolean;  
    every?: boolean;  
    fill?: boolean;  
    filter?: boolean;  
    find?: boolean;  
    findIndex?: boolean;  
    findLast?: boolean;  
    findLastIndex?: boolean;  
    flat?: boolean;  
    flatMap?: boolean;  
    forEach?: boolean;  
    includes?: boolean;  
    indexOf?: boolean;  
    join?: boolean;  
    keys?: boolean;  
    lastIndexOf?: boolean;  
    length?: boolean;  
    map?: boolean;  
    pop?: boolean;  
    push?: boolean;  
    reduce?: boolean;  
    reduceRight?: boolean;  
    reverse?: boolean;  
    shift?: boolean;  
    slice?: boolean;  
    some?: boolean;  
    sort?: boolean;  
    splice?: boolean;  
    toLocaleString?: boolean;  
    toReversed?: boolean;  
    toSorted?: boolean;  
    toSpliced?: boolean;  
    toString?: boolean;  
    unshift?: boolean;  
    values?: boolean;  
    with?: boolean;  
    \[key: number\]: boolean | undefined;  
}

Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.

#### Type Declaration

-   ##### \[key: number\]: boolean | undefined
    
-   ##### `Optional`\[iterator\]?: boolean
    
-   ##### `Optional` `Readonly`\[unscopables\]?: boolean
    
    Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.
    
-   ##### `Optional`at?: boolean
    
-   ##### `Optional`concat?: boolean
    
-   ##### `Optional`copyWithin?: boolean
    
-   ##### `Optional`entries?: boolean
    
-   ##### `Optional`every?: boolean
    
-   ##### `Optional`fill?: boolean
    
-   ##### `Optional`filter?: boolean
    
-   ##### `Optional`find?: boolean
    
-   ##### `Optional`findIndex?: boolean
    
-   ##### `Optional`findLast?: boolean
    
-   ##### `Optional`findLastIndex?: boolean
    
-   ##### `Optional`flat?: boolean
    
-   ##### `Optional`flatMap?: boolean
    
-   ##### `Optional`forEach?: boolean
    
-   ##### `Optional`includes?: boolean
    
-   ##### `Optional`indexOf?: boolean
    
-   ##### `Optional`join?: boolean
    
-   ##### `Optional`keys?: boolean
    
-   ##### `Optional`lastIndexOf?: boolean
    
-   ##### `Optional`length?: boolean
    
    Gets or sets the length of the array. This is a number one higher than the highest index in the array.
    
-   ##### `Optional`map?: boolean
    
-   ##### `Optional`pop?: boolean
    
-   ##### `Optional`push?: boolean
    
-   ##### `Optional`reduce?: boolean
    
-   ##### `Optional`reduceRight?: boolean
    
-   ##### `Optional`reverse?: boolean
    
-   ##### `Optional`shift?: boolean
    
-   ##### `Optional`slice?: boolean
    
-   ##### `Optional`some?: boolean
    
-   ##### `Optional`sort?: boolean
    
-   ##### `Optional`splice?: boolean
    
-   ##### `Optional`toLocaleString?: boolean
    
-   ##### `Optional`toReversed?: boolean
    
-   ##### `Optional`toSorted?: boolean
    
-   ##### `Optional`toSpliced?: boolean
    
-   ##### `Optional`toString?: boolean
    
-   ##### `Optional`unshift?: boolean
    
-   ##### `Optional`values?: boolean
    
-   ##### `Optional`with?: boolean
    

Inherited from Array.\[unscopables\]

### length[](#length)

length: number

Gets or sets the length of the array. This is a number one higher than the highest index in the array.

Inherited from Array.length

### `Static` `Readonly`\[species\][](#species)

"\[species\]": ArrayConstructor

Inherited from Array.\[species\]

## Methods[](#methods-1)

### \[iterator\][](#iterator)

-   "\[iterator\]"(): [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<[ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\>[](#iterator-1)
    
    Iterator
    
    #### Returns [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<[ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\>
    
    Inherited from Array.\[iterator\]
    

### `Maptiler`at[](#at)

-   at(pos: number): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)[](#at-1)
    
    Returns the item located at the specified index.
    
    #### Parameters
    
    -   pos: number
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
    
    Overrides Array.at
    

### `Maptiler`clone[](#clone)

-   clone(): ColorRamp[](#clone-1)
    
    #### Returns ColorRamp
    

### concat[](#concat)

-   concat(...items: [ConcatArray](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ConcatArray/)<[ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\>\[\]): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\][](#concat-1)
    
    Combines two or more arrays. This method returns a new array without modifying any existing arrays.
    
    #### Parameters
    
    -   ...items: [ConcatArray](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ConcatArray/)<[ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\>\[\]
        
        Additional arrays and/or items to add to the end of the array.
        
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
    
    Inherited from Array.concat
    
-   concat(...items: ([ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/) | [ConcatArray](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ConcatArray/)<[ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\>)\[\]): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\][](#concat-2)
    
    Combines two or more arrays. This method returns a new array without modifying any existing arrays.
    
    #### Parameters
    
    -   ...items: ([ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/) | [ConcatArray](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ConcatArray/)<[ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\>)\[\]
        
        Additional arrays and/or items to add to the end of the array.
        
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
    
    Inherited from Array.concat
    

### copyWithin[](#copywithin)

-   copyWithin(target: number, start: number, end?: number): this[](#copywithin-1)
    
    Returns the this object after copying a section of the array identified by start and end to the same array starting at position target
    
    #### Parameters
    
    -   target: number
        
        If target is negative, it is treated as length+target where length is the length of the array.
        
    -   start: number
        
        If start is negative, it is treated as length+start. If end is negative, it is treated as length+end.
        
    -   `Optional`end: number
        
        If not specified, length of the this object is used as its default value.
        
    
    #### Returns this
    
    Inherited from Array.copyWithin
    

### entries[](#entries)

-   entries(): [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<\[number, [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\]\>[](#entries-1)
    
    Returns an iterable of key, value pairs for every entry in the array
    
    #### Returns [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<\[number, [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\]\>
    
    Inherited from Array.entries
    

### every[](#every)

-   every<[S](#everys) extends [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\>(  
        predicate: (  
            value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            index: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> value is [S](#everys),  
        thisArg?: any,  
    ): this is [S](#everys)\[\][](#every-1)
    
    Determines whether all the members of an array satisfy the specified test.
    
    #### Type Parameters
    
    -   S extends [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
    
    #### Parameters
    
    -   predicate: (value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), index: number, array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]) \=> value is [S](#everys)
        
        A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.
        
    -   `Optional`thisArg: any
        
        An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
        
    
    #### Returns this is [S](#everys)\[\]
    
    Inherited from Array.every
    
-   every(  
        predicate: (  
            value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            index: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> unknown,  
        thisArg?: any,  
    ): boolean[](#every-2)
    
    Determines whether all the members of an array satisfy the specified test.
    
    #### Parameters
    
    -   predicate: (value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), index: number, array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]) \=> unknown
        
        A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.
        
    -   `Optional`thisArg: any
        
        An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
        
    
    #### Returns boolean
    
    Inherited from Array.every
    

### fill[](#fill)

-   fill(value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), start?: number, end?: number): this[](#fill-1)
    
    Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
    
    #### Parameters
    
    -   value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
        
        value to fill array section with
        
    -   `Optional`start: number
        
        index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array.
        
    -   `Optional`end: number
        
        index to stop filling the array at. If end is negative, it is treated as length+end.
        
    
    #### Returns this
    
    Inherited from Array.fill
    

### filter[](#filter)

-   filter<[S](#filters) extends [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\>(  
        predicate: (  
            value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            index: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> value is [S](#filters),  
        thisArg?: any,  
    ): [S](#filters)\[\][](#filter-1)
    
    Returns the elements of an array that meet the condition specified in a callback function.
    
    #### Type Parameters
    
    -   S extends [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
    
    #### Parameters
    
    -   predicate: (value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), index: number, array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]) \=> value is [S](#filters)
        
        A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
        
    -   `Optional`thisArg: any
        
        An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
        
    
    #### Returns [S](#filters)\[\]
    
    Inherited from Array.filter
    
-   filter(  
        predicate: (  
            value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            index: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> unknown,  
        thisArg?: any,  
    ): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\][](#filter-2)
    
    Returns the elements of an array that meet the condition specified in a callback function.
    
    #### Parameters
    
    -   predicate: (value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), index: number, array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]) \=> unknown
        
        A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
        
    -   `Optional`thisArg: any
        
        An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
        
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
    
    Inherited from Array.filter
    

### find[](#find)

-   find<[S](#finds) extends [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\>(  
        predicate: (  
            value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            index: number,  
            obj: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> value is [S](#finds),  
        thisArg?: any,  
    ): [S](#finds) | undefined[](#find-1)
    
    Returns the value of the first element in the array where predicate is true, and undefined otherwise.
    
    #### Type Parameters
    
    -   S extends [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
    
    #### Parameters
    
    -   predicate: (value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), index: number, obj: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]) \=> value is [S](#finds)
        
        find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined.
        
    -   `Optional`thisArg: any
        
        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.
        
    
    #### Returns [S](#finds) | undefined
    
    Inherited from Array.find
    
-   find(  
        predicate: (  
            value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            index: number,  
            obj: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> unknown,  
        thisArg?: any,  
    ): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/) | undefined[](#find-2)
    
    #### Parameters
    
    -   predicate: (value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), index: number, obj: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]) \=> unknown
    -   `Optional`thisArg: any
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/) | undefined
    
    Inherited from Array.find
    

### findIndex[](#findindex)

-   findIndex(  
        predicate: (  
            value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            index: number,  
            obj: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> unknown,  
        thisArg?: any,  
    ): number[](#findindex-1)
    
    Returns the index of the first element in the array where predicate is true, and -1 otherwise.
    
    #### Parameters
    
    -   predicate: (value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), index: number, obj: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]) \=> unknown
        
        find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1.
        
    -   `Optional`thisArg: any
        
        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.
        
    
    #### Returns number
    
    Inherited from Array.findIndex
    

### findLast[](#findlast)

-   findLast<[S](#findlasts) extends [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\>(  
        predicate: (  
            value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            index: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> value is [S](#findlasts),  
        thisArg?: any,  
    ): [S](#findlasts) | undefined[](#findlast-1)
    
    Returns the value of the last element in the array where predicate is true, and undefined otherwise.
    
    #### Type Parameters
    
    -   S extends [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
    
    #### Parameters
    
    -   predicate: (value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), index: number, array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]) \=> value is [S](#findlasts)
        
        findLast calls predicate once for each element of the array, in descending order, until it finds one where predicate returns true. If such an element is found, findLast immediately returns that element value. Otherwise, findLast returns undefined.
        
    -   `Optional`thisArg: any
        
        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.
        
    
    #### Returns [S](#findlasts) | undefined
    
    Inherited from Array.findLast
    
-   findLast(  
        predicate: (  
            value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            index: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> unknown,  
        thisArg?: any,  
    ): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/) | undefined[](#findlast-2)
    
    #### Parameters
    
    -   predicate: (value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), index: number, array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]) \=> unknown
    -   `Optional`thisArg: any
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/) | undefined
    
    Inherited from Array.findLast
    

### findLastIndex[](#findlastindex)

-   findLastIndex(  
        predicate: (  
            value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            index: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> unknown,  
        thisArg?: any,  
    ): number[](#findlastindex-1)
    
    Returns the index of the last element in the array where predicate is true, and -1 otherwise.
    
    #### Parameters
    
    -   predicate: (value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), index: number, array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]) \=> unknown
        
        findLastIndex calls predicate once for each element of the array, in descending order, until it finds one where predicate returns true. If such an element is found, findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
        
    -   `Optional`thisArg: any
        
        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.
        
    
    #### Returns number
    
    Inherited from Array.findLastIndex
    

### flat[](#flat)

-   flat<[A](#flata), [D](#flatd) extends number \= 1\>(this: [A](#flata), depth?: [D](#flatd)): [FlatArray](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.FlatArray/)<[A](#flata), [D](#flatd)\>\[\][](#flat-1)
    
    Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.
    
    #### Type Parameters
    
    -   A
    -   D extends number = 1
    
    #### Parameters
    
    -   this: [A](#flata)
    -   `Optional`depth: [D](#flatd)
        
        The maximum recursion depth
        
    
    #### Returns [FlatArray](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.FlatArray/)<[A](#flata), [D](#flatd)\>\[\]
    
    Inherited from Array.flat
    

### flatMap[](#flatmap)

-   flatMap<[U](#flatmapu), [This](#flatmapthis) \= undefined\>(  
        callback: (  
            this: [This](#flatmapthis),  
            value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            index: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> [U](#flatmapu) | readonly [U](#flatmapu)\[\],  
        thisArg?: [This](#flatmapthis),  
    ): [U](#flatmapu)\[\][](#flatmap-1)
    
    Calls a defined callback function on each element of an array. Then, flattens the result into a new array. This is identical to a map followed by flat with depth 1.
    
    #### Type Parameters
    
    -   U
    -   This = undefined
    
    #### Parameters
    
    -   callback: (  
            this: [This](#flatmapthis),  
            value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            index: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> [U](#flatmapu) | readonly [U](#flatmapu)\[\]
        
        A function that accepts up to three arguments. The flatMap method calls the callback function one time for each element in the array.
        
    -   `Optional`thisArg: [This](#flatmapthis)
        
        An object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used as the this value.
        
    
    #### Returns [U](#flatmapu)\[\]
    
    Inherited from Array.flatMap
    

### forEach[](#foreach)

-   forEach(  
        callbackfn: (  
            value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            index: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> void,  
        thisArg?: any,  
    ): void[](#foreach-1)
    
    Performs the specified action for each element in an array.
    
    #### Parameters
    
    -   callbackfn: (value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), index: number, array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]) \=> void
        
        A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
        
    -   `Optional`thisArg: any
        
        An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
        
    
    #### Returns void
    
    Inherited from Array.forEach
    

### `Maptiler`getBounds[](#getbounds)

-   getBounds(): { max: number; min: number }[](#getbounds-1)
    
    #### Returns { max: number; min: number }
    

### `Maptiler`getCanvasStrip[](#getcanvasstrip)

-   getCanvasStrip(  
        options?: { horizontal?: boolean; size?: number; smooth?: boolean },  
    ): [HTMLCanvasElement](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLCanvasElement/)[](#getcanvasstrip-1)
    
    #### Parameters
    
    -   options: { horizontal?: boolean; size?: number; smooth?: boolean } = ...
    
    #### Returns [HTMLCanvasElement](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.HTMLCanvasElement/)
    

### `Maptiler`getColor[](#getcolor)

-   getColor(value: number, options?: { smooth?: boolean }): [RgbaColor](https://docs.maptiler.com/sdk-js/api-reference/types/RgbaColor/)[](#getcolor-1)
    
    #### Parameters
    
    -   value: number
    -   options: { smooth?: boolean } = ...
    
    #### Returns [RgbaColor](https://docs.maptiler.com/sdk-js/api-reference/types/RgbaColor/)
    

### `Maptiler`getColorHex[](#getcolorhex)

-   getColorHex(  
        value: number,  
        options?: { smooth?: boolean; withAlpha?: boolean },  
    ): string[](#getcolorhex-1)
    
    Get the color as an hexadecimal string
    
    #### Parameters
    
    -   value: number
    -   options: { smooth?: boolean; withAlpha?: boolean } = ...
    
    #### Returns string
    

### `Maptiler`getColorRelative[](#getcolorrelative)

-   getColorRelative(value: number, options?: { smooth?: boolean }): [RgbaColor](https://docs.maptiler.com/sdk-js/api-reference/types/RgbaColor/)[](#getcolorrelative-1)
    
    Get the color of the color ramp at a relative position in \[0, 1\]
    
    #### Parameters
    
    -   value: number
    -   options: { smooth?: boolean } = ...
    
    #### Returns [RgbaColor](https://docs.maptiler.com/sdk-js/api-reference/types/RgbaColor/)
    

### `Maptiler`getRawColorStops[](#getrawcolorstops)

-   getRawColorStops(): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\][](#getrawcolorstops-1)
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
    

### `Maptiler`hasTransparentStart[](#hastransparentstart)

-   hasTransparentStart(): boolean[](#hastransparentstart-1)
    
    Check if this color ramp has a transparent start
    
    #### Returns boolean
    

### includes[](#includes)

-   includes(searchElement: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), fromIndex?: number): boolean[](#includes-1)
    
    Determines whether an array includes a certain element, returning true or false as appropriate.
    
    #### Parameters
    
    -   searchElement: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
        
        The element to search for.
        
    -   `Optional`fromIndex: number
        
        The position in this array at which to begin searching for searchElement.
        
    
    #### Returns boolean
    
    Inherited from Array.includes
    

### indexOf[](#indexof)

-   indexOf(searchElement: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), fromIndex?: number): number[](#indexof-1)
    
    Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
    
    #### Parameters
    
    -   searchElement: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
        
        The value to locate in the array.
        
    -   `Optional`fromIndex: number
        
        The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
        
    
    #### Returns number
    
    Inherited from Array.indexOf
    

### join[](#join)

-   join(separator?: string): string[](#join-1)
    
    Adds all the elements of an array into a string, separated by the specified separator string.
    
    #### Parameters
    
    -   `Optional`separator: string
        
        A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma.
        
    
    #### Returns string
    
    Inherited from Array.join
    

### keys[](#keys)

-   keys(): [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<number\>[](#keys-1)
    
    Returns an iterable of keys in the array
    
    #### Returns [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<number\>
    
    Inherited from Array.keys
    

### lastIndexOf[](#lastindexof)

-   lastIndexOf(searchElement: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), fromIndex?: number): number[](#lastindexof-1)
    
    Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.
    
    #### Parameters
    
    -   searchElement: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
        
        The value to locate in the array.
        
    -   `Optional`fromIndex: number
        
        The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array.
        
    
    #### Returns number
    
    Inherited from Array.lastIndexOf
    

### map[](#map)

-   map<[U](#mapu)\>(  
        callbackfn: (value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), index: number, array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]) \=> [U](#mapu),  
        thisArg?: any,  
    ): [U](#mapu)\[\][](#map-1)
    
    Calls a defined callback function on each element of an array, and returns an array that contains the results.
    
    #### Type Parameters
    
    -   U
    
    #### Parameters
    
    -   callbackfn: (value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), index: number, array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]) \=> [U](#mapu)
        
        A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
        
    -   `Optional`thisArg: any
        
        An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
        
    
    #### Returns [U](#mapu)\[\]
    
    Inherited from Array.map
    

### pop[](#pop)

-   pop(): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/) | undefined[](#pop-1)
    
    Removes the last element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/) | undefined
    
    Inherited from Array.pop
    

### push[](#push)

-   push(...items: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]): number[](#push-1)
    
    Appends new elements to the end of an array, and returns the new length of the array.
    
    #### Parameters
    
    -   ...items: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
        
        New elements to add to the array.
        
    
    #### Returns number
    
    Inherited from Array.push
    

### reduce[](#reduce)

-   reduce(  
        callbackfn: (  
            previousValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentIndex: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
    ): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)[](#reduce-1)
    
    Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
    
    #### Parameters
    
    -   callbackfn: (  
            previousValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentIndex: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
        
        A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
        
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
    
    Inherited from Array.reduce
    
-   reduce(  
        callbackfn: (  
            previousValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentIndex: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
        initialValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
    ): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)[](#reduce-2)
    
    #### Parameters
    
    -   callbackfn: (  
            previousValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentIndex: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
    -   initialValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
    
    Inherited from Array.reduce
    
-   reduce<[U](#reduceu)\>(  
        callbackfn: (  
            previousValue: [U](#reduceu),  
            currentValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentIndex: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> [U](#reduceu),  
        initialValue: [U](#reduceu),  
    ): [U](#reduceu)[](#reduce-3)
    
    Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
    
    #### Type Parameters
    
    -   U
    
    #### Parameters
    
    -   callbackfn: (  
            previousValue: [U](#reduceu),  
            currentValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentIndex: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> [U](#reduceu)
        
        A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
        
    -   initialValue: [U](#reduceu)
        
        If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
        
    
    #### Returns [U](#reduceu)
    
    Inherited from Array.reduce
    

### reduceRight[](#reduceright)

-   reduceRight(  
        callbackfn: (  
            previousValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentIndex: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
    ): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)[](#reduceright-1)
    
    Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
    
    #### Parameters
    
    -   callbackfn: (  
            previousValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentIndex: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
        
        A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
        
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
    
    Inherited from Array.reduceRight
    
-   reduceRight(  
        callbackfn: (  
            previousValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentIndex: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
        initialValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
    ): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)[](#reduceright-2)
    
    #### Parameters
    
    -   callbackfn: (  
            previousValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentIndex: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
    -   initialValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
    
    Inherited from Array.reduceRight
    
-   reduceRight<[U](#reducerightu)\>(  
        callbackfn: (  
            previousValue: [U](#reducerightu),  
            currentValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentIndex: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> [U](#reducerightu),  
        initialValue: [U](#reducerightu),  
    ): [U](#reducerightu)[](#reduceright-3)
    
    Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
    
    #### Type Parameters
    
    -   U
    
    #### Parameters
    
    -   callbackfn: (  
            previousValue: [U](#reducerightu),  
            currentValue: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            currentIndex: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> [U](#reducerightu)
        
        A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
        
    -   initialValue: [U](#reducerightu)
        
        If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
        
    
    #### Returns [U](#reducerightu)
    
    Inherited from Array.reduceRight
    

### `Maptiler`resample[](#resample)

-   resample(  
        method:  
            | "ease-in-square"  
            | "ease-out-square"  
            | "ease-in-sqrt"  
            | "ease-out-sqrt"  
            | "ease-in-exp"  
            | "ease-out-exp",  
        samples?: number,  
    ): ColorRamp[](#resample-1)
    
    Apply a non-linear ressampling. This will create a new instance of ColorRamp with the same bounds.
    
    #### Parameters
    
    -   method:  
            | "ease-in-square"  
            | "ease-out-square"  
            | "ease-in-sqrt"  
            | "ease-out-sqrt"  
            | "ease-in-exp"  
            | "ease-out-exp"
    -   samples: number = 15
    
    #### Returns ColorRamp
    

### `Maptiler`reverse[](#reverse)

-   reverse(options?: { clone?: boolean }): ColorRamp[](#reverse-1)
    
    Reverses the elements in an array in place. This method mutates the array and returns a reference to the same array.
    
    #### Parameters
    
    -   options: { clone?: boolean } = ...
    
    #### Returns ColorRamp
    
    Overrides Array.reverse
    

### `Maptiler`scale[](#scale)

-   scale(min: number, max: number, options?: { clone?: boolean }): ColorRamp[](#scale-1)
    
    #### Parameters
    
    -   min: number
    -   max: number
    -   options: { clone?: boolean } = ...
    
    #### Returns ColorRamp
    

### `Maptiler`setStops[](#setstops)

-   setStops(stops: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\], options?: { clone?: boolean }): ColorRamp[](#setstops-1)
    
    #### Parameters
    
    -   stops: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
    -   options: { clone?: boolean } = ...
    
    #### Returns ColorRamp
    

### shift[](#shift)

-   shift(): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/) | undefined[](#shift-1)
    
    Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/) | undefined
    
    Inherited from Array.shift
    

### slice[](#slice)

-   slice(start?: number, end?: number): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\][](#slice-1)
    
    Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. For example, -2 refers to the second to last element of the array.
    
    #### Parameters
    
    -   `Optional`start: number
        
        The beginning index of the specified portion of the array. If start is undefined, then the slice begins at index 0.
        
    -   `Optional`end: number
        
        The end index of the specified portion of the array. This is exclusive of the element at the index 'end'. If end is undefined, then the slice extends to the end of the array.
        
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
    
    Inherited from Array.slice
    

### some[](#some)

-   some(  
        predicate: (  
            value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/),  
            index: number,  
            array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
        ) \=> unknown,  
        thisArg?: any,  
    ): boolean[](#some-1)
    
    Determines whether the specified callback function returns true for any element of an array.
    
    #### Parameters
    
    -   predicate: (value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), index: number, array: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]) \=> unknown
        
        A function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array.
        
    -   `Optional`thisArg: any
        
        An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
        
    
    #### Returns boolean
    
    Inherited from Array.some
    

### sort[](#sort)

-   sort(compareFn?: (a: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), b: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)) \=> number): this[](#sort-1)
    
    Sorts an array in place. This method mutates the array and returns a reference to the same array.
    
    #### Parameters
    
    -   `Optional`compareFn: (a: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), b: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)) \=> number
        
        Function used to determine the order of the elements. It is expected to return a negative value if the first argument is less than the second argument, zero if they're equal, and a positive value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order.
        
        ```typescript
        [11,2,22,1].sort((a, b) => a - b)
        ```
        
    
    #### Returns this
    
    Inherited from Array.sort
    

### splice[](#splice)

-   splice(start: number, deleteCount?: number): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\][](#splice-1)
    
    Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
    
    #### Parameters
    
    -   start: number
        
        The zero-based location in the array from which to start removing elements.
        
    -   `Optional`deleteCount: number
        
        The number of elements to remove. Omitting this argument will remove all elements from the start paramater location to end of the array. If value of this argument is either a negative number, zero, undefined, or a type that cannot be converted to an integer, the function will evaluate the argument as zero and not remove any elements.
        
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
    
    An array containing the elements that were deleted.
    
    Inherited from Array.splice
    
-   splice(start: number, deleteCount: number, ...items: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\][](#splice-2)
    
    Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
    
    #### Parameters
    
    -   start: number
        
        The zero-based location in the array from which to start removing elements.
        
    -   deleteCount: number
        
        The number of elements to remove. If value of this argument is either a negative number, zero, undefined, or a type that cannot be converted to an integer, the function will evaluate the argument as zero and not remove any elements.
        
    -   ...items: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
        
        Elements to insert into the array in place of the deleted elements.
        
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
    
    An array containing the elements that were deleted.
    
    Inherited from Array.splice
    

### toLocaleString[](#tolocalestring)

-   toLocaleString(): string[](#tolocalestring-1)
    
    Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.
    
    #### Returns string
    
    Inherited from Array.toLocaleString
    
-   toLocaleString(  
        locales: string | string\[\],  
        options?: NumberFormatOptions & DateTimeFormatOptions,  
    ): string[](#tolocalestring-2)
    
    #### Parameters
    
    -   locales: string | string\[\]
    -   `Optional`options: NumberFormatOptions & DateTimeFormatOptions
    
    #### Returns string
    
    Inherited from Array.toLocaleString
    

### toReversed[](#toreversed)

-   toReversed(): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\][](#toreversed-1)
    
    Returns a copy of an array with its elements reversed.
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
    
    Inherited from Array.toReversed
    

### toSorted[](#tosorted)

-   toSorted(compareFn?: (a: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), b: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)) \=> number): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\][](#tosorted-1)
    
    Returns a copy of an array with its elements sorted.
    
    #### Parameters
    
    -   `Optional`compareFn: (a: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/), b: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)) \=> number
        
        Function used to determine the order of the elements. It is expected to return a negative value if the first argument is less than the second argument, zero if they're equal, and a positive value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order.
        
        ```typescript
        [11, 2, 22, 1].toSorted((a, b) => a - b) // [1, 2, 11, 22]
        ```
        
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
    
    Inherited from Array.toSorted
    

### toSpliced[](#tospliced)

-   toSpliced(  
        start: number,  
        deleteCount: number,  
        ...items: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\],  
    ): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\][](#tospliced-1)
    
    Copies an array and removes elements and, if necessary, inserts new elements in their place. Returns the copied array.
    
    #### Parameters
    
    -   start: number
        
        The zero-based location in the array from which to start removing elements.
        
    -   deleteCount: number
        
        The number of elements to remove.
        
    -   ...items: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
        
        Elements to insert into the copied array in place of the deleted elements.
        
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
    
    The copied array.
    
    Inherited from Array.toSpliced
    
-   toSpliced(start: number, deleteCount?: number): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\][](#tospliced-2)
    
    Copies an array and removes elements while returning the remaining elements.
    
    #### Parameters
    
    -   start: number
        
        The zero-based location in the array from which to start removing elements.
        
    -   `Optional`deleteCount: number
        
        The number of elements to remove.
        
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
    
    A copy of the original array with the remaining elements.
    
    Inherited from Array.toSpliced
    

### toString[](#tostring)

-   toString(): string[](#tostring-1)
    
    Returns a string representation of an array.
    
    #### Returns string
    
    Inherited from Array.toString
    

### `Maptiler`transparentStart[](#transparentstart)

-   transparentStart(): ColorRamp[](#transparentstart-1)
    
    Makes a clone of this color ramp that is fully transparant at the begining of their range
    
    #### Returns ColorRamp
    

### unshift[](#unshift)

-   unshift(...items: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]): number[](#unshift-1)
    
    Inserts new elements at the start of an array, and returns the new length of the array.
    
    #### Parameters
    
    -   ...items: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
        
        Elements to insert at the start of the array.
        
    
    #### Returns number
    
    Inherited from Array.unshift
    

### values[](#values)

-   values(): [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<[ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\>[](#values-1)
    
    Returns an iterable of values in the array
    
    #### Returns [ArrayIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayIterator/)<[ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\>
    
    Inherited from Array.values
    

### with[](#with)

-   with(index: number, value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)): [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\][](#with-1)
    
    Copies an array, then overwrites the value at the provided index with the given value. If the index is negative, then it replaces from the end of the array.
    
    #### Parameters
    
    -   index: number
        
        The index of the value to overwrite. If the index is negative, then it replaces from the end of the array.
        
    -   value: [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)
        
        The value to write into the copied array.
        
    
    #### Returns [ColorStop](https://docs.maptiler.com/sdk-js/api-reference/types/ColorStop/)\[\]
    
    The copied array with the updated value.
    
    Inherited from Array.with
    

### `Static`from[](#from)

-   from<[T](#fromt)\>(arrayLike: [ArrayLike](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayLike/)<[T](#fromt)\>): [T](#fromt)\[\][](#from-1)
    
    Creates an array from an array-like object.
    
    #### Type Parameters
    
    -   T
    
    #### Parameters
    
    -   arrayLike: [ArrayLike](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayLike/)<[T](#fromt)\>
        
        An array-like object to convert to an array.
        
    
    #### Returns [T](#fromt)\[\]
    
    Inherited from Array.from
    
-   from<[T](#fromt-1), [U](#fromu)\>(  
        arrayLike: [ArrayLike](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayLike/)<[T](#fromt-1)\>,  
        mapfn: (v: [T](#fromt-1), k: number) \=> [U](#fromu),  
        thisArg?: any,  
    ): [U](#fromu)\[\][](#from-2)
    
    Creates an array from an iterable object.
    
    #### Type Parameters
    
    -   T
    -   U
    
    #### Parameters
    
    -   arrayLike: [ArrayLike](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayLike/)<[T](#fromt-1)\>
        
        An array-like object to convert to an array.
        
    -   mapfn: (v: [T](#fromt-1), k: number) \=> [U](#fromu)
        
        A mapping function to call on every element of the array.
        
    -   `Optional`thisArg: any
        
        Value of 'this' used to invoke the mapfn.
        
    
    #### Returns [U](#fromu)\[\]
    
    Inherited from Array.from
    
-   from<[T](#fromt-2)\>(iterable: [Iterable](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Iterable/)<[T](#fromt-2), any, any\> | [ArrayLike](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayLike/)<[T](#fromt-2)\>): [T](#fromt-2)\[\][](#from-3)
    
    Creates an array from an iterable object.
    
    #### Type Parameters
    
    -   T
    
    #### Parameters
    
    -   iterable: [Iterable](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Iterable/)<[T](#fromt-2), any, any\> | [ArrayLike](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayLike/)<[T](#fromt-2)\>
        
        An iterable object to convert to an array.
        
    
    #### Returns [T](#fromt-2)\[\]
    
    Inherited from Array.from
    
-   from<[T](#fromt-3), [U](#fromu-1)\>(  
        iterable: [Iterable](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Iterable/)<[T](#fromt-3), any, any\> | [ArrayLike](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayLike/)<[T](#fromt-3)\>,  
        mapfn: (v: [T](#fromt-3), k: number) \=> [U](#fromu-1),  
        thisArg?: any,  
    ): [U](#fromu-1)\[\][](#from-4)
    
    Creates an array from an iterable object.
    
    #### Type Parameters
    
    -   T
    -   U
    
    #### Parameters
    
    -   iterable: [Iterable](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Iterable/)<[T](#fromt-3), any, any\> | [ArrayLike](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.ArrayLike/)<[T](#fromt-3)\>
        
        An iterable object to convert to an array.
        
    -   mapfn: (v: [T](#fromt-3), k: number) \=> [U](#fromu-1)
        
        A mapping function to call on every element of the array.
        
    -   `Optional`thisArg: any
        
        Value of 'this' used to invoke the mapfn.
        
    
    #### Returns [U](#fromu-1)\[\]
    
    Inherited from Array.from
    

### `Static` `Maptiler`fromArrayDefinition[](#fromarraydefinition)

-   fromArrayDefinition(cr: [ArrayColorRamp](https://docs.maptiler.com/sdk-js/api-reference/types/ArrayColorRamp/)): ColorRamp[](#fromarraydefinition-1)
    
    Converts a array-definition color ramp definition into a usable ColorRamp instance. Note: units are not converted and may need to to be converted beforehand (eg. kelvin to centigrade)
    
    #### Parameters
    
    -   cr: [ArrayColorRamp](https://docs.maptiler.com/sdk-js/api-reference/types/ArrayColorRamp/)
    
    #### Returns ColorRamp
    

### `Static`isArray[](#isarray)

-   isArray(arg: any): arg is any\[\][](#isarray-1)
    
    #### Parameters
    
    -   arg: any
    
    #### Returns arg is any\[\]
    
    Inherited from Array.isArray
    

### `Static`of[](#of)

-   of<[T](#oft)\>(...items: [T](#oft)\[\]): [T](#oft)\[\][](#of-1)
    
    Returns a new array from a set of elements.
    
    #### Type Parameters
    
    -   T
    
    #### Parameters
    
    -   ...items: [T](#oft)\[\]
        
        A set of elements to include in the new array object.
        
    
    #### Returns [T](#oft)\[\]
    
    Inherited from Array.of
