icons

package
v0.16.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: EPL-2.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package icons gives a gowt app named system icons: SF Symbols on macOS, Segoe Fluent Icons on Windows, freedesktop symbolic icons on Linux, with an embedded Lucide set where the OS has none, so the same names work everywhere. Get returns a *gowt.Image tinted for the current theme; Names lists the valid names and FromSVG makes an image from your own SVG. See https://github.com/haiodo/gowt/blob/main/docs/icons.md.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromSVG

func FromSVG(a *gowt.App, data []byte, size int, c gowt.RGB) *gowt.Image

FromSVG returns an image size x size points drawn from the SVG document data at every zoom, with currentColor in c (Lucide, Tabler and other monochrome icons). Images are cached per document, size and colour like Get's: calling FromSVG again with the colour of the new theme makes a new image only for a colour not seen before. The App owns the image like every gowt.Image.

func Get

func Get(a *gowt.App, name string, opts ...Option) *gowt.Image

Get returns the named icon from the system set of the current OS (SF Symbols, Segoe Fluent Icons, freedesktop symbolic icons), or from the embedded Lucide set when the system has none. The result is drawn at every zoom and tinted for the theme at call time: after App.OnThemeChange call Get again (the old image keeps its colour). On macOS an icon without a Color option is also a template image (NSImage isTemplate): AppKit draws it in the label colour in buttons, tool items and menu items (white on a highlight), and a look.SetSidebar Table tints it in the accent colour when its row is selected. Images from FromSVG, App.ImageFromProvider, App.ImageFrom and App.LoadImage are never templates. Images are cached per name, size and colour and owned by the App like every gowt.Image; after a Dispose, Get makes the image again. It panics on an unknown name; Names lists the valid ones.

func Names

func Names() []string

Names lists the names Get accepts, sorted.

Types

type Option

type Option func(*iconConfig)

Option adjusts Get.

func Color

func Color(c gowt.RGB) Option

Color sets the tint; by default light gray in dark mode and near-black in light mode. On macOS an icon with a Color is not a template image: it keeps that colour wherever it is shown.

func Size

func Size(points int) Option

Size sets the icon's side in points (default 16).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL