Skip to content

Commit

Permalink
Add the 'quick' colorset to the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dustmop committed Jul 22, 2021
1 parent 77865dd commit 8ceab6f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ra.setZoom(8);

## Drawing pixels

Clearing the display can be done using the `fillBackground` method. Raster.js uses a limited color palette, just like many retro computer systems, limited to at most 256 colors. The default palette can be found in the "colors" section. Functions that require a color parameter, such as `fillBackground`, therefore only require a single numerical parameter, which uses that color from the palette.
Clearing the display can be done using the `fillBackground` method. Raster.js uses a limited color palette, just like many retro computer systems, limited to at most 256 colors. The default palette can be found in the "colors" section below. Functions that require a color parameter, such as `fillBackground`, therefore only require a single numerical parameter, which uses that color from the palette.

```
ra.fillBackground(12);
Expand Down Expand Up @@ -155,6 +155,14 @@ Change the zoom level.

Use a specific colorSet. See `useColors` in the docs for supported colorSets.

# Colors

The current default colorset for raster.js is the "quick" palette, shown here:

![](asset/quick-colorset.png)

This is likely to change in a future version. Users should either add `ra.useColors('quick')` to their code, or be prepared to update the colors they use once this change happens.

# API

See [the docs](docs.md) for the full documentation of the methods avaiable in raster.js.
Binary file added asset/quick-colorset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,15 @@ Move the x,y coordinate system's origin to the center of the plane, instead of t

Assigns the color set to use for displaying the scene. May either be the name of a pre-existing color set, or a list of rgb values.

If not invoked, the current default colorset is this:
![](asset/quick-colorset.png)

This will likely change in the future: call `useColors('quick')` unless you want to modify your scripts in the future.

Names of pre-existing color sets:

`quick`: The current default colorset, shown above. 64 colors, a quick and simple rainbow palette.

`dos`: Colors used by the DOS operating system. TODO: Specify which video standard.

`nes`: Colors used by the NES 8-bit console.
Expand Down

0 comments on commit 8ceab6f

Please sign in to comment.