mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-09-06 19:44:15 -04:00
Merge pull request #1109 from gucio321/d2font
d2dat: add New method for DATPalette
This commit is contained in:
commit
cfcd303252
@ -15,6 +15,16 @@ type DATPalette struct {
|
|||||||
colors [numColors]d2interface.Color
|
colors [numColors]d2interface.Color
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// New creates a new dat palette
|
||||||
|
func New() *DATPalette {
|
||||||
|
result := &DATPalette{}
|
||||||
|
for i := range result.colors {
|
||||||
|
result.colors[i] = &DATColor{}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
// NumColors returns the number of colors in the palette
|
// NumColors returns the number of colors in the palette
|
||||||
func (p *DATPalette) NumColors() int {
|
func (p *DATPalette) NumColors() int {
|
||||||
return len(p.colors)
|
return len(p.colors)
|
||||||
|
Loading…
Reference in New Issue
Block a user