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

13 lines
246 B
Go
Raw Normal View History

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
}