Reference · Rockets, variants, parts and the fit check
lampFactorfunction
How bright a lamp is now, from 0 to 1. Position lights stay on. The white flash and the red beacon pulse, and both hold steady when motion is reduced. Work lights (floods, pools, docking and work lamps)
are on only for all.
Import it
import { lampFactor } from "@johnmorrisdotca/uchusen-rockets";
Definition
function lampFactor(duty: LampDuty, mode: "off" | "running" | "all", reduced: boolean, seconds: number): number
Parameters
| Name | Type | Description |
|---|---|---|
duty | LampDuty | What the lamp is. |
mode | "all" | "off" | "running" | The Lights choice. |
reduced | boolean | Whether the reader asked for reduced motion. |
seconds | number | Seconds since the view started. |
Returns
number
The brightness, 0 to 1. Engine glow is always 1 here: the Engines switch applies that itself.
Examples
import { lampFactor } from "@johnmorrisdotca/uchusen-rockets";
console.log(lampFactor("flash", "all", false, 0), lampFactor("flash", "all", true, 0));1 0.45What it prints (run when this page was built)