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 ( PackedColorArray from )

PackedColorArray

PackedColorArray ( Array from )

Methods

bool

append ( Color value )

void

append_array ( PackedColorArray array )

int

bsearch ( Color value, bool before=true )

void

clear ( )

int

count ( Color value ) const

PackedColorArray

duplicate ( )

void

fill ( Color value )

int

find ( Color value, int from=0 ) const

bool

has ( Color value ) const

int

insert ( int at_index, Color value )

bool

is_empty ( ) const

bool

push_back ( Color value )

void

remove_at ( int index )

int

resize ( int new_size )

void

reverse ( )

int

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

void

set ( int index, Color value )

int

size ( ) const

PackedColorArray

slice ( int begin, int end=2147483647 ) const

void

sort ( )

PackedByteArray

to_byte_array ( ) const

Operators

bool

operator != ( PackedColorArray right )

PackedColorArray

operator + ( PackedColorArray right )

bool

operator == ( PackedColorArray right )

Color

operator [] ( int index )


Constructor Descriptions

PackedColorArray PackedColorArray ( )

Constructs an empty PackedColorArray.


PackedColorArray PackedColorArray ( PackedColorArray from )

Constructs a PackedColorArray as a copy of the given PackedColorArray.


PackedColorArray PackedColorArray ( Array from )

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 Color values:

var array = PackedColorArray([Color(0.1, 0.2, 0.3), Color(