Skip to main content

Class: P5AsciifyColorPalette

Defined in: ColorPalette.ts:10

A 1D color palette stored in a framebuffer that is used to pass colors to shaders.

There is no need to modify instances of this class provided by the library, as they are managed internally and can be modified more easily through classes managing them. But you technically could - if you wanted to - without breaking anything.

Constructors​

Constructor​

new P5AsciifyColorPalette(_p, _colors): P5AsciifyColorPalette

Defined in: ColorPalette.ts:20

Create a new color palette instance.

Parameters​

ParameterTypeDescription
_pp5The p5 instance.
_colorsColor[]The colors to store.

Returns​

P5AsciifyColorPalette

Accessors​

colors​

Get Signature​

get colors(): Color[]

Defined in: ColorPalette.ts:72

Get the colors of the palette.

Returns​

Color[]


framebuffer​

Get Signature​

get framebuffer(): Framebuffer

Defined in: ColorPalette.ts:77

Get the framebuffer containing the colors of the palette.

Returns​

Framebuffer

Methods​

setColors()​

setColors(newColors): void

Defined in: ColorPalette.ts:64

Sets the colors of the palette and updates the framebuffer.

Parameters​

ParameterTypeDescription
newColorsColor[]The new colors to set.

Returns​

void