getSoilColor
Function: getSoilColor()
Section titled “Function: getSoilColor()”Call Signature
Section titled “Call Signature”function getSoilColor(colour): string | null;Defined in: src/colors.ts:110
Get the hex color for a BRO soil colour code.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
colour | Coded | null | undefined | A coded colour value (e.g. layer.colour), or null/undefined |
Returns
Section titled “Returns”string | null
Hex color string, or null if the code is absent or not recognised
Example
Section titled “Example”getSoilColor(layer.colour); // '#b79a77'getSoilColor({ code: 'lichtBruin', codeSpace }); // '#b79a77'getSoilColor(null); // nullCall Signature
Section titled “Call Signature”function getSoilColor(colour, defaultColor): string;Defined in: src/colors.ts:123
Get the hex color for a BRO soil colour code, falling back to a default.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
colour | Coded | null | undefined | A coded colour value, or null/undefined |
defaultColor | string | Fallback color returned when the code is absent or unknown |
Returns
Section titled “Returns”string
Hex color string, or defaultColor if the code is absent or unknown
Example
Section titled “Example”getSoilColor(null, '#808080'); // '#808080'