consoleColorfunctionnacatamalon
consoleColor(color: TColorOption, levels: number) => TColorA colour as a console could show it: each channel moved to the nearest of the steps that machine
had, POST_EFFECTS.COLOR_LEVELS.genesis (8) for a Mega Drive, POST_EFFECTS.COLOR_LEVELS.snes (32) for a SNES.
Why it matters under dither: the effect leaves a colour that is on one of its steps flat, and
puts its pattern on everything in between, because in between is what a gradient is. A tile tinted
'#e8423f' sits between steps, so it comes out checkered; consoleColor('#e8423f', POST_EFFECTS.COLOR_LEVELS.genesis) is #db4949, on the steps, and comes out flat, while a sky's gradient still
gets the pattern. A screen effect cannot make that choice: it sees pixels, not which ones were
meant to be flat.
Takes what getColor takes, or a colour already made. Alpha is left as it is, and the colour given
is never changed.
Parameters
colorTColorOptionA colour: a hex number or string, any CSS colour, or a
TColor.levelsnumberSteps per channel, from
POST_EFFECTS.COLOR_LEVELSor any number from2up.
Example
usePostProcess(dither({ levels: POST_EFFECTS.COLOR_LEVELS.genesis }));
createSprite({ width: 16, height: 16, tint: consoleColor('#e8423f', POST_EFFECTS.COLOR_LEVELS.genesis) });