reckfellENGINE

VoxelColorPalette

Limited list of 256 colors in 8-bit format that can be indexed quickly.

On this page
class VoxelColorPaletteReckfellSharpInherits Resource

Limited list of 256 colors in 8-bit format that can be indexed quickly.

Contains a list of colors that can be accessed quickly by their index. This is useful to store colored voxels with small memory footprint. It can be used with VoxelMesherCubes. Note: colors are internally stored with 8-bit components, so floats used by Color will be rounded to the nearest value.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

VoxelColorPaletteConstructor
# VoxelColorPalette
C#
public VoxelColorPalette();

Properties2

ColorsProperty
# Colors
C#
public Color[] Colors { get; set; }

Array of all the colors in the palette. It must have 256 elements. You may use this if you want to get or set all colors at once. Otherwise, prefer using VoxelColorPalette.GetColor and VoxelColorPalette.SetColor.

DataProperty
# Data
C#
public int[] Data { get; set; }

Array used to store colors as 8-bit binary components in the resource file. It must have 256 elements. To access colors with a script, prefer using VoxelColorPalette.GetColor and VoxelColorPalette.SetColor.

Methods8

GetColorColor
# GetColor
C#
public Color GetColor(int index);

Gets the color at the given index.

Parameters
NameTypeDefault
indexint—
Returns Color
GetColorsColor[]
# GetColors
C#
public Color[] GetColors();
Returns Color[]
GetDataint[]
# GetData
C#
public int[] GetData();
Returns int[]
SetColorvoid
# SetColor
C#
public void SetColor(int index, Color color);

Sets the color at the given index.

Parameters
NameTypeDefault
indexint—
colorColor—
SetColors2 overloads
# SetColors · 1/2
C#
public void SetColors(Color[] colors);
Parameters
NameTypeDefault
colorsColor[]—
# SetColors · 2/2
C#
public void SetColors(ReadOnlySpan<Color> colors);
Parameters
NameTypeDefault
colorsReadOnlySpan<Color>—
SetData2 overloads
# SetData · 1/2
C#
public void SetData(int[] d);
Parameters
NameTypeDefault
dint[]—
# SetData · 2/2
C#
public void SetData(ReadOnlySpan<int> d);
Parameters
NameTypeDefault
dReadOnlySpan<int>—

Fields and constants1

MaxColorsField
# MaxColors
C#
public const long MaxColors = 256;
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.