ReferenceScripting APIMotionColour
MotionColour
interfaceColour for code (scene.colour, or import { colour } from "motion"): colours are "#rrggbb".
| Name | MotionColour |
|---|---|
| Kind | interface |
| Script reaches it as | colour, or import { colour } from "motion" · MotionScene.colour · motion.colour |
| Since | 0.4 |
Syntax
interface MotionColour { … }declare const colour: MotionColour;Methods
| Signature | Description |
|---|---|
mix(a: string, b: string, t: number): stringmethod | Between two colours, t of the way. |
fromHsv(h: number, s: number, v: number): stringmethod | A colour from its hue, saturation and value. |
toHsv(c: string): [number, number, number]method | A colour's hue, saturation and value, 0 to 1 each. |
lighten(c: string, k: number): stringmethod | Toward white or black. |
saturate(c: string, k: number): stringmethod | More colourful, or greyer. |
opposite(c: string): stringmethod | Its opposite round the colour wheel. |
fromKelvin(kelvin: number): stringmethod | The colour of light at a temperature. |
Notes from the community
Written by creators and checked by the docs' editors. Not part of Motion's official reference.