gabrielflorit / script-8.github.io

A JavaScript-based (React + Redux) fantasy computer for making, sharing, and playing tiny retro-looking games.
https://script-8.github.io/
MIT License
646 stars 35 forks source link

Add colorSwap to API #283

Closed gabrielflorit closed 5 years ago

gabrielflorit commented 5 years ago

How about this:

colorSwap(from, to)
  Swaps one color with another. Applies to any drawing calls. Reset with `colorSwap()`.

colorSwap()
  Resets any previous color swaps.

@Kethku if I understand your frame buffer renderer, everything goes through setPixel, correct? So to add this colorSwap, I only need to modify the setPixel function?