Syntax
- string colorRamp(gradient, value)
Parameters
- gradient—string{ whiteToBlack | greenToRed |yellowToRed | redToBlue | orangeToBlue | brownToBlue | spectrum }—selector for different color ramp presets.
- value—float ( range[0,1])
Returns
Hex color value from a color ramp (selected with gradient) according to the given value. Means the value is mapped on the color ramp and the corresponding color is returned.
Description
The colorRamp function returns the hex color value from a color ramp (selected with gradient) according to the given value.
Examples
Yellow to red color ramp
| ![]() |
Ramp example images based on a GIS dataset
Yellow to red:
![Yellow to red Yellow to red](GUID-BB993E7F-B895-4785-BBD7-84A1AD80064D-web.png)
Red to blue:
![Red to blue Red to blue](GUID-EFACA99C-C8CE-4111-8CFE-8D412A6C7B37-web.png)
Green to red:
![Green to red Green to red](GUID-BC68D9A2-5CEA-4777-887B-AEEF8328B30A-web.png)
White to black:
![White to black White to black](GUID-32F64326-4E1B-43F4-B1C2-712DD3147487-web.png)
Orange to blue:
![Orange to blue Orange to blue](GUID-50D29F70-2F1D-4090-B0C9-667D4C708609-web.png)
Brown to blue:
![Brown to blue Brown to blue](GUID-9015AA38-FEA5-4AEE-8C4F-361C28414420-web.png)
Spectrum:
![Spectrum Spectrum](GUID-E665DB70-529E-4D93-A45F-80EB7D1DB0F6-web.png)