theme.ThemedResource
import "fyne.io/fyne/v2/theme"Usage
type ThemedResource
type ThemedResource struct {
// ColorName specifies which theme colour should be used to theme the resource
//
// Since: 2.3
ColorName fyne.ThemeColorName
}ThemedResource is a resource wrapper that will return a version of the resource with the main color changed for the currently selected theme.
func NewColoredResource
func NewColoredResource(src fyne.Resource, name fyne.ThemeColorName) *ThemedResourceNewColoredResource creates a resource that adapts to the current theme setting using the color named in the constructor.
2.4func NewSuccessThemedResource
func NewSuccessThemedResource(src fyne.Resource) *ThemedResourceNewSuccessThemedResource creates a resource that adapts to the current theme success color.
2.4func NewThemedResource
func NewThemedResource(src fyne.Resource) *ThemedResourceNewThemedResource creates a resource that adapts to the current theme setting. By default, this will match the foreground color, but it can be changed using the ColorName field.
func NewWarningThemedResource
func NewWarningThemedResource(src fyne.Resource) *ThemedResourceNewWarningThemedResource creates a resource that adapts to the current theme warning color.
2.4func (*ThemedResource) Content
func (res *ThemedResource) Content() []byteContent returns the underlying content of the resource adapted to the current text color.
func (*ThemedResource) Error
func (res *ThemedResource) Error() *ErrorThemedResourceError returns a different resource for indicating an error.
func (*ThemedResource) Name
func (res *ThemedResource) Name() stringName returns the underlying resource name (used for caching).
func (*ThemedResource) ThemeColorName
func (res *ThemedResource) ThemeColorName() fyne.ThemeColorNameThemeColorName returns the fyne.ThemeColorName that is used as foreground color.