Show / Hide Table of Contents

Class DFPalette

Describes a 256-colour Daggerfall palette. Supports loading .PAL and .COL files. Palette is initialised to all 0xff0000 (red) to make it obvious when palette isn't loaded.

Inheritance
Object
DFPalette
Namespace: DaggerfallConnect
Assembly: Assembly-CSharp.dll
Syntax
public class DFPalette

Constructors

| Improve this Doc View Source

DFPalette()

Default constructor. Palette is initialised with red.

Declaration
public DFPalette()
| Improve this Doc View Source

DFPalette(DFPalette)

Copy constructor.

Declaration
public DFPalette(DFPalette other)
Parameters
Type Name Description
DFPalette other

Palette to copy from.

| Improve this Doc View Source

DFPalette(String)

Load constructor (supports both .PAL and .COL files).

Declaration
public DFPalette(string FilePath)
Parameters
Type Name Description
String FilePath

Absolute path to palette file.

Properties

| Improve this Doc View Source

HeaderLength

Gets palette header length;

Declaration
public int HeaderLength { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

PaletteBuffer

Gets palette memory buffer.

Declaration
public byte[] PaletteBuffer { get; }
Property Value
Type Description
Byte[]

Methods

| Improve this Doc View Source

Fill(Byte, Byte, Byte)

Fills entire palette with specified RGB value.

Declaration
public void Fill(byte R, byte G, byte B)
Parameters
Type Name Description
Byte R

Red component.

Byte G

Green component.

Byte B

Blue component.

| Improve this Doc View Source

Find(Byte, Byte, Byte)

Finds index with specified RGB values.

Declaration
public int Find(byte R, byte G, byte B)
Parameters
Type Name Description
Byte R

Red component.

Byte G

Green component.

Byte B

Blue component.

Returns
Type Description
Int32

Index of found RGB value.

| Improve this Doc View Source

Get(Int32)

Gets colour at specified index.

Declaration
public DFColor Get(int Index)
Parameters
Type Name Description
Int32 Index

Index into colour array.

Returns
Type Description
DFColor

DFColor object.

| Improve this Doc View Source

GetBlue(Int32)

Gets blue colour value at index.

Declaration
public byte GetBlue(int Index)
Parameters
Type Name Description
Int32 Index

Index into colour array.

Returns
Type Description
Byte

Blue value byte.

| Improve this Doc View Source

GetGreen(Int32)

Gets green colour value at index.

Declaration
public byte GetGreen(int Index)
Parameters
Type Name Description
Int32 Index

Index into colour array.

Returns
Type Description
Byte

Green value byte.

| Improve this Doc View Source

GetRed(Int32)

Gets red colour value at index.

Declaration
public byte GetRed(int Index)
Parameters
Type Name Description
Int32 Index

Index into colour array.

Returns
Type Description
Byte

Red value byte.

| Improve this Doc View Source

Load(String)

Loads a Daggerfall palette file (supports both .PAL and .COL files).

Declaration
public bool Load(string FilePath)
Parameters
Type Name Description
String FilePath

Absolute path to palette file.

Returns
Type Description
Boolean

True if successful, otherwise false.

| Improve this Doc View Source

MakeAutomap()

Fills palette with AutoMap colours. The AutoMap colour index is equal to BuildingTypes value + 1.

Declaration
public void MakeAutomap()
| Improve this Doc View Source

MakeGrayscale()

Fills entire palette with grayscale values.

Declaration
public void MakeGrayscale()
| Improve this Doc View Source

MakeRandom()

Fills entire palette with random values.

Declaration
public void MakeRandom()
| Improve this Doc View Source

Multiply(Int32)

Declaration
public void Multiply(int scale)
Parameters
Type Name Description
Int32 scale
| Improve this Doc View Source

Read(ref BinaryReader)

Read palette information from a binary reader. Palette must be a 768-byte PalFile structure (256x 24-bit RGB values).

Declaration
public bool Read(ref BinaryReader Reader)
Parameters
Type Name Description
BinaryReader Reader

Source reader positioned at start of palette data.

Returns
Type Description
Boolean

True if successful, otherwise false.

| Improve this Doc View Source

Set(Byte[])

Sets 768-byte palette buffer directly.

Declaration
public void Set(byte[] data)
Parameters
Type Name Description
Byte[] data

Data to set.

| Improve this Doc View Source

Set(Int32, Byte, Byte, Byte)

Sets index to specified RGB values.

Declaration
public void Set(int Index, byte R, byte G, byte B)
Parameters
Type Name Description
Int32 Index

Index into colour array.

Byte R

Red component.

Byte G

Green component.

Byte B

Blue component.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX