Cleaned out the old theme code and moved padding and margins to theme

This commit is contained in:
Sasha Koshka 2023-02-26 00:44:44 -05:00
parent 7e51dc5e5a
commit 2859dc3313
7 changed files with 112 additions and 561 deletions

View File

@ -12,3 +12,16 @@ type Uniform color.RGBA
func (pattern Uniform) Draw (destination canvas.Canvas, clip image.Rectangle) { func (pattern Uniform) Draw (destination canvas.Canvas, clip image.Rectangle) {
shapes.FillColorRectangle(destination, color.RGBA(pattern), clip) shapes.FillColorRectangle(destination, color.RGBA(pattern), clip)
} }
// Uhex creates a new Uniform pattern from an RGBA integer value.
func Uhex (color uint32) (uniform Uniform) {
return Uniform(hex(color))
}
func hex (color uint32) (c color.RGBA) {
c.A = uint8(color)
c.B = uint8(color >> 8)
c.G = uint8(color >> 16)
c.R = uint8(color >> 24)
return
}

View File

@ -2,15 +2,6 @@ package config
// Config can return global configuration parameters. // Config can return global configuration parameters.
type Config interface { type Config interface {
// Padding returns the amount of internal padding elements should have.
// An element's inner content (such as text) should be inset by this
// amount, in addition to the inset returned by the pattern of its
// background.
Padding () int
// Margin returns how much space should be put in between elements.
Margin () int
// HandleWidth returns how large grab handles should typically be. This // HandleWidth returns how large grab handles should typically be. This
// is important for accessibility reasons. // is important for accessibility reasons.
HandleWidth () int HandleWidth () int