@PALETTE id[, filename$][, table]
If you pass the filename$
argument, the palette will be loaded from that file.
The file specified in filename$
can either be in the IFF ILBM palette format,
as established by Deluxe Paint, or, alternatively, filename$
can also
be a normal image file that contains a palette. In that case, @PALETTE
will simply extract the palette from the image file. Be advised, though, that
if you pass a full image file to @PALETTE
and compile your script into an
applet or executable, Hollywood will link the whole image file to your applet
or executable, which will increase the output file size. Thus, it is advised
to only use palette files in the IFF ILBM format with @PALETTE
because those
are really small as they don't contain any image data.
If you don't pass the filename$
argument, you need to set either the Type
or Colors
tag in the optional table argument to define the palette (see below).
The optional table argument recognizes the following tags:
Type:
Type
to the identifier of the desired inbuilt palette.
See SetStandardPalette for a list of inbuilt palettes.
If you set this tag, you must not pass filename$
or Colors
.
Colors:
Colors
, you
must not pass filename$
or Type
. To define a custom palette, set Colors
to a table containing the desired colors for the palette. The palette depth
is calculated automatically from the number of colors in the table. Alternatively,
you can also set the Depth
tag to define the palette depth (see below).
Depth:
Colors
tag. If Depth
specifies more colors than you pass in the table in the
Colors
tag, the remaining colors will be initialized to black.
TransparentPen:
#NOPEN
which means that no pen shall be made
transparent. This must only be used when the Type
or Colors
tag is passed
as well.
Link:
False
if you do not want to have filename$
linked to your executable/applet when you compile your script.
This field defaults to True
which means that the palette will be linked
to your executable/applet when Hollywood is in compile mode.
If you use this tag, you must also pass filename$
.
Loader:
filename$
. This must be set to a string
containing the name(s) of one or more loader(s). Defaults to the loader set using SetDefaultLoader().
See Loaders and adapters for details. If you use this tag, you must
also pass filename$
.
Adapter:
filename$
. This must be set to a string containing the name(s)
of one or more adapter(s). Defaults to the adapter set using SetDefaultAdapter().
See Loaders and adapters for details. If you use this tag, you must also pass filename$
.
UserTags:
To load or create palettes at runtime, take a look at the LoadPalette() and CreatePalette() commands.
@PALETTE 1, "DPaint32.pal"Preloads "DPaint32.pal" as palette 1.
@PALETTE 1, {Colors = {#WHITE, #BLACK, $7777CC, $BBBBBB}}Defines a custom palette as palette 1.
@PALETTE 1, {Type = #PALETTE_CGA}Defines the standard CGA palette as palette 1.