1681-engine / index / ColorGrade
Class: ColorGrade ​
Defined in: src/ambient/ColorGrade.ts:30
A colour laid over the whole screen in multiply, so it tints the world (a marsh mossy, a peak ember, a dead land pale) without washing the art toward white the way a normal-blend sheet would. One white quad, tinted: no filter pass, which is what a phone can spare every frame.
read returns the grade now (gradeAt from a place's Grade and DayClock's night, say); it is asked a few times a second, and a grade that comes to white is not drawn at all. Give placement: 'bottom' to keep it off the HUD (see ColorGradeOptions.placement).
Constructors ​
Constructor ​
new ColorGrade(
stage,
read,
options?
): ColorGrade;Defined in: src/ambient/ColorGrade.ts:36
Parameters ​
| Parameter | Type |
|---|---|
stage | Stage |
read | () => GradeState | null |
options | ColorGradeOptions |
Returns ​
ColorGrade
Methods ​
destroy() ​
destroy(): void;Defined in: src/ambient/ColorGrade.ts:75
Returns ​
void
invalidate() ​
invalidate(): void;Defined in: src/ambient/ColorGrade.ts:50
Reads the grade again on the next update (the place changed).
Returns ​
void
update() ​
update(now, enabled?): void;Defined in: src/ambient/ColorGrade.ts:55
enabled: the game's setting, and off under a battery saver — a full-screen blend is a cost on a phone.
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
now | number | undefined |
enabled | boolean | true |
Returns ​
void