Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

PackedColorArray

A packed array of Colors.

Description

An array specifically designed to hold Color. Packs data tightly, so it saves memory for large array sizes.

Note

There are notable differences when using this API with C#. See C# API differences to GDScript for more information.

Constructors

PackedColorArray

PackedColorArray()

PackedColorArray

PackedColorArray(from: PackedColorArray)

PackedColorArray

PackedColorArray(from: Array)

Methods

bool

append(value: Color)

void

append_array(array: PackedColorArray)

int

bsearch(value: Color, before: bool = true)

void

clear()

int

count(value: Color) const

PackedColorArray

duplicate()

void

fill(value: Color)

int

find(value: Color, from: int = 0) const

bool

has(value: Color) const

int

insert(at_index: int, value: Color)

bool

is_empty() const

bool

push_back(value: Color)

void

remove_at(index: int)

int

resize(new_size: int)

void

reverse()

int

rfind(value: Color, from: int = -1) const

void

set(index: int, value: Color)

int

size() const

PackedColorArray

slice(begin: int, end: int = 2147483647) const

void

sort()

PackedByteArray

to_byte_array() const

Operators

bool

operator !=(right: PackedColorArray)

PackedColorArray

operator +(right: PackedColorArray)

bool

operator ==(right: PackedColorArray)

Color

operator [](index: int)


Constructor Descriptions

PackedColorArray PackedColorArray()

Constructs an empty PackedColorArray.


PackedColorArray PackedColorArray(from: PackedColorArray)

Constructs a PackedColorArray as a copy of the given PackedColorArray.


PackedColorArray PackedColorArray(from: Array)

Constructs a new PackedColorArray. Optionally, you can pass in a generic Array that will be converted.

Note: When initializing a PackedColorArray with elements, it must be initialized with an Array of