getSoilColor
Function: getSoilColor()
Section titled “Function: getSoilColor()”Call Signature
Section titled “Call Signature”function getSoilColor(colorName): string | null;Defined in: src/colors.ts:108
Get the hex color for a BRO soil color name.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
colorName | string | BRO color name (e.g., “lichtBruin”, “donkerGrijs”) |
Returns
Section titled “Returns”string | null
Hex color string, or null if the name is not found
Example
Section titled “Example”getSoilColor('lichtBruin'); // '#b79a77'getSoilColor('LICHTBRUIN'); // '#b79a77' (case-insensitive)getSoilColor('unknown'); // nullCall Signature
Section titled “Call Signature”function getSoilColor(colorName, defaultColor): string;Defined in: src/colors.ts:121
Get the hex color for a BRO soil color name, falling back to a default.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
colorName | string | BRO color name (e.g., “lichtBruin”, “donkerGrijs”) |
defaultColor | string | Fallback color returned when the name is not found |
Returns
Section titled “Returns”string
Hex color string, or defaultColor if the name is not found
Example
Section titled “Example”getSoilColor('unknown', '#808080'); // '#808080'