Added table patterns

This commit is contained in:
Sasha Koshka 2023-04-02 21:15:16 -04:00
parent bc72333ff0
commit 7521808872
3 changed files with 18 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -16,7 +16,7 @@ import "git.tebibyte.media/sashakoshka/tomo/artist/patterns"
//go:embed assets/wintergreen.png //go:embed assets/wintergreen.png
var defaultAtlasBytes []byte var defaultAtlasBytes []byte
var defaultAtlas canvas.Canvas var defaultAtlas canvas.Canvas
var defaultTextures [14][9]artist.Pattern var defaultTextures [16][9]artist.Pattern
//go:embed assets/wintergreen-icons-small.png //go:embed assets/wintergreen-icons-small.png
var defaultIconsSmallAtlasBytes []byte var defaultIconsSmallAtlasBytes []byte
var defaultIconsSmall [640]binaryIcon var defaultIconsSmall [640]binaryIcon
@ -107,6 +107,10 @@ func init () {
atlasCol(8, artist.Inset { 1, 1, 1, 1 }) atlasCol(8, artist.Inset { 1, 1, 1, 1 })
// PatternMercury // PatternMercury
atlasCol(13, artist.Inset { 2, 2, 2, 2 }) atlasCol(13, artist.Inset { 2, 2, 2, 2 })
// PatternTableHead:
atlasCol(14, artist.Inset { 4, 4, 4, 4 })
// PatternTableCell:
atlasCol(15, artist.Inset { 4, 4, 4, 4 })
// PatternButton: basic.checkbox // PatternButton: basic.checkbox
atlasCol(9, artist.Inset { 3, 3, 3, 3 }) atlasCol(9, artist.Inset { 3, 3, 3, 3 })
@ -232,6 +236,8 @@ func (Default) Pattern (id tomo.Pattern, state tomo.State, c tomo.Case) artist.P
case tomo.PatternHandle: return defaultTextures[7][offset] case tomo.PatternHandle: return defaultTextures[7][offset]
case tomo.PatternLine: return defaultTextures[8][offset] case tomo.PatternLine: return defaultTextures[8][offset]
case tomo.PatternMercury: return defaultTextures[13][offset] case tomo.PatternMercury: return defaultTextures[13][offset]
case tomo.PatternTableHead: return defaultTextures[14][offset]
case tomo.PatternTableCell: return defaultTextures[15][offset]
default: return patterns.Uhex(0xFF00FFFF) default: return patterns.Uhex(0xFF00FFFF)
} }
} }

View File

@ -73,6 +73,12 @@ type Pattern int; const (
// PatternMercury is a fill pattern for progress bars, meters, etc. // PatternMercury is a fill pattern for progress bars, meters, etc.
PatternMercury PatternMercury
// PatternTableHead is a table row or column heading background.
PatternTableHead
// PatternTableCell is a table cell background.
PatternTableCell
) )
// IconSize is a type representing valid icon sizes. // IconSize is a type representing valid icon sizes.