1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-18 18:36:12 -05:00
OpenDiablo2/d2common/d2fileformats/d2dat/dat.go

14 lines
320 B
Go
Raw Normal View History

2020-06-28 22:32:34 -04:00
// Package d2dat contains the logic for loading and processing DAT files.
package d2dat
2020-06-28 22:32:34 -04:00
// Load loads a DAT file.
func Load(data []byte) (*DATPalette, error) {
palette := &DATPalette{}
for i := 0; i < 256; i++ {
palette.Colors[i] = DATColor{B: data[i*3], G: data[i*3+1], R: data[i*3+2]}
}
return palette, nil
}