Skip to content
A

getSoilColor

function getSoilColor(colour): string | null;

Defined in: src/colors.ts:110

Get the hex color for a BRO soil colour code.

ParameterTypeDescription
colourCoded | null | undefinedA coded colour value (e.g. layer.colour), or null/undefined

string | null

Hex color string, or null if the code is absent or not recognised

getSoilColor(layer.colour); // '#b79a77'
getSoilColor({ code: 'lichtBruin', codeSpace }); // '#b79a77'
getSoilColor(null); // null
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.

ParameterTypeDescription
colourCoded | null | undefinedA coded colour value, or null/undefined
defaultColorstringFallback color returned when the code is absent or unknown

string

Hex color string, or defaultColor if the code is absent or unknown

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