Skip to content
A

getSoilColor

function getSoilColor(colorName): string | null;

Defined in: src/colors.ts:108

Get the hex color for a BRO soil color name.

ParameterTypeDescription
colorNamestringBRO color name (e.g., “lichtBruin”, “donkerGrijs”)

string | null

Hex color string, or null if the name is not found

getSoilColor('lichtBruin'); // '#b79a77'
getSoilColor('LICHTBRUIN'); // '#b79a77' (case-insensitive)
getSoilColor('unknown'); // null
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.

ParameterTypeDescription
colorNamestringBRO color name (e.g., “lichtBruin”, “donkerGrijs”)
defaultColorstringFallback color returned when the name is not found

string

Hex color string, or defaultColor if the name is not found

getSoilColor('unknown', '#808080'); // '#808080'