Name
LoadPalette -- load a palette (V9.0)
Synopsis
[id] = LoadPalette(id, filename$[, table])
Function
This function loads the palette specified by filename$ into memory and assigns the identifier id to it. If you pass Nil in id, LoadPalette() will automatically choose an identifier and return it.

The palette 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, LoadPalette() will simply extract the palette from the image file.

The third argument is optional. It is a table that can be used to set further options for the loading operation. The following fields of the table can be used:

Loader:
This tag allows you to specify one or more format loaders that should be asked to load this palette. 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.

Adapter:
This tag allows you to specify one or more file adapters that should be asked to open the specified file. 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.

UserTags:
This tag can be used to specify additional data that should be passed to loaders and adapters. If you use this tag, you must set it to a table of key-value pairs that contain the additional data that should be passed to plugins. See User tags for details. (V10.0)

This command is also available from the preprocessor: Use @PALETTE to preload palettes.

Inputs
id
identifier for the palette or Nil for auto id selection
filename$
file to load
table
optional: further options (see above)
Results
id
optional: identifier of the palette; will only be returned when you pass Nil as argument 1 (see above)
Example
LoadPalette(1, "DPaint32.pal")
This loads "DPaint32.pal" as palette 1.

Show TOC