lineStrengthFromAttributefunction
The strength from the attribute constellation-lines, read as text. Off (undefined) when the attribute is missing, 0, off or false; constellation-lines with no value is the default strength (0.16); a number is the strength, held to 0 up to 1.
Import it
import { lineStrengthFromAttribute } from "@johnmorrisdotca/hoshi-stars/sky-labels";
Definition
function lineStrengthFromAttribute(value: string | null | undefined): number | undefined
Parameters
| Name | Type | Description |
|---|---|---|
value | string | null | undefined | The value of |
Returns
number | undefined
The strength, or undefined when the lines are off.
Examples
import { lineStrengthFromAttribute } from "@johnmorrisdotca/hoshi-stars/sky-labels";
console.log(lineStrengthFromAttribute("0.3"), lineStrengthFromAttribute(""), lineStrengthFromAttribute(null), lineStrengthFromAttribute("0"));0.3 0.16 undefined undefinedWhat it prints (run when this page was built)