Skip to main content

vec4b

Class

A 4-component boolean vector with x/y/z/w and r/g/b/a accessors.

Index

Properties

Methods

Example

const flags = new vec4b(true, false, true, false);
// flags.r === true, flags.g === false, flags.b === true, flags.a === false

const allTrue = new vec4b(true, true, true, true);
const allFalse = new vec4b(false, false, false, false);

Constructors

Constructor

new vec4b(x, y, z, w): vec4b

Constructs a vec4b from four boolean components x, y, z, and w.

Parameters

ParameterType
xboolean
yboolean
zboolean
wboolean

Returns

vec4b

Properties

a

a: boolean

The alpha (w) boolean component.


b

b: boolean

The blue (z) boolean component.


g

g: boolean

The green (y) boolean component.


r

r: boolean

The red (x) boolean component.


w

w: boolean

The fourth (w) boolean component.


x

x: boolean

The first (x) boolean component.


y

y: boolean

The second (y) boolean component.


z

z: boolean

The third (z) boolean component.

Methods

toString()

toString(): string

Returns a string representation of the vector.

Returns

string