NAME
SIRTX::VM::Chunk::Type::ColourPalette - module for interacting with SIRTX VM chunks
VERSION
version v0.02
SYNOPSIS
use SIRTX::VM::Chunk::Type::ColourPalette;
my SIRTX::VM::Chunk $chunk = SIRTX::VM::Chunk::Type::ColourPalette->new;
$chunk->offset($first_id);
$chunk->add_colour(@colours);
(since v0.02)
This type represents a colour palette. Such a palette consists of a number of colour values being mapped to user-defined-identifiers.
This inherits from SIRTX::VM::Chunk.
offset
my $offset = $chunk->offset;
# or:
$chunk->offset($offset);
(experimental since v0.02)
This gets or sets the offset of the colour plaette into the user-defined-identifier space.
The types and ranges used by this method are subject to change.
Note: As per specification of the identifier space a value of zero (null-identifier) is invalid. Values past 2^16-1 (or: 0xFFFF) are also invalid.
get_colour
my $colour = $chunks->get_colour($idx);
(experimental since v0.02)
Gets a colour by it's user-defined-identifier.
The types and ranges used by this method are subject to change.
set_colour
$chunks->set_colour($idx => $colour);
(experimental since v0.02)
Sets a colour by it's user-defined-identifier.
The types and ranges used by this method are subject to change.
Note: This method may refuse setting colours if the result would creat an invalid state that could not be written. This is specifically true for creating holes. Hence it is recommended to add colours using "add_colour" or add them in-order.
add_colour
$chunks->add_colour($colour);
(experimental since v0.02)
Adds a colour to the palette.
The types and ranges used by this method are subject to change.
AUTHOR
Löwenfelsen UG (haftungsbeschränkt) <support@loewenfelsen.net>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2025 by Löwenfelsen UG (haftungsbeschränkt) <support@loewenfelsen.net>.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)