Lightning API
Lightning
Extends Effect.
Factory Function
typescript
createLightning(config?: LightningConfig)Methods
See Effect for the full method reference: mount(), start(), pause(), resume(), configure(), withFade(), and destroy().
LightningConfig
typescript
interface LightningConfig {
frequency?: number;
color?: string;
branches?: boolean;
flash?: boolean;
scale?: number;
}| Property | Type | Default | Description |
|---|---|---|---|
frequency | number | 1 | Bolt spawn rate multiplier. 1 means roughly one bolt every 3 seconds. |
color | string | '#b4c8ff' | Hex color string for the bolt glow. The inner line is always white. |
branches | boolean | true | Enable smaller branch bolts forking off the main bolt. |
flash | boolean | true | Enable a brief white screen flash when a bolt strikes. |
scale | number | 1 | Global scale factor for line widths. |