Skip to content

Icons

Icon :: struct {...}
icon :: proc(ic: Icon, style := TextStyle.Body, tone := Tone.Default)
icon_empty :: proc(ic: Icon) -> bool
icon_pixels :: proc(width, height: int, pixels: []Pixel) -> Icon
load_icon :: proc(path: string) -> (Icon, bool)
ICON_CALENDAR :: Icon{...}
ICON_CHECK :: Icon{...}
ICON_CHEVRON_DOWN :: Icon{...}
ICON_CHEVRON_LEFT :: Icon{...}
ICON_CHEVRON_RIGHT :: Icon{...}
ICON_CHEVRON_UP :: Icon{...}
ICON_CLOSE :: Icon{...}
ICON_EYE :: Icon{...}
ICON_EYE_OFF :: Icon{...}
ICON_MENU :: Icon{...}
ICON_MINUS :: Icon{...}
ICON_MORE :: Icon{...}
ICON_PLUS :: Icon{...}
ICON_SEARCH :: Icon{...}
ICON_STAR :: Icon{...}
Icon :: struct {
svg: string, // an SVG document, e.g. `#load("icons/menu.svg", string)`
glyph: string, // or a character of the font, e.g. "★"
image: Image, // or an image, scaled to the icon height
tint: bool, // draw `image` in the text color (single-color images; `load_icon` decides)
}

An icon. Set one of the fields; the zero value is “no icon”. Icons are plain values, so they can be constants and live in tables (NavItem, TreeNode).

FieldTypeNotes
svgstringan SVG document, e.g. #load("icons/menu.svg", string)
glyphstringor a character of the font, e.g. ”★”
imageImageor an image, scaled to the icon height
tintbooldraw image in the text color (single-color images; load_icon decides)

Source: kiln/icon.odin:24

icon :: proc(ic: Icon, style := TextStyle.Body, tone := Tone.Default)

An icon at the size of text in style, in the color of tone (if it has a single color).

kiln.icon(kiln.ICON_STAR, .Title, .Warning)
ArgumentTypeDefault
icIconrequired
styleTextStyleTextStyle.Body
toneToneTone.Default

Source: kiln/icon.odin:86

icon_empty :: proc(ic: Icon) -> bool

True for the zero Icon.

ArgumentTypeDefault
icIconrequired
ReturnsType
#0bool

Source: kiln/icon.odin:133

icon_pixels :: proc(width, height: int, pixels: []Pixel) -> Icon

An icon from RGBA pixels (row by row, top to bottom), with the same color rule as load_icon.

ArgumentTypeDefault
widthintrequired
heightintrequired
pixels[]Pixelrequired
ReturnsType
#0Icon

Source: kiln/icon.odin:110

load_icon :: proc(path: string) -> (Icon, bool)

Loads an icon from a file: an SVG, or an image (PNG, JPG, …). Images with a single color (e.g. black on transparent) are tinted like text, colorful ones are drawn as they are. Call it after the window opened (in init); the icon lives until the app ends.

ArgumentTypeDefault
pathstringrequired
ReturnsType
#0Icon
#1bool

Source: kiln/icon.odin:98

ICON_CALENDAR :: Icon{...}

Source: kiln/icon.odin:70

ICON_CHECK :: Icon{...}

Source: kiln/icon.odin:37

ICON_CHEVRON_DOWN :: Icon{...}

Source: kiln/icon.odin:43

ICON_CHEVRON_LEFT :: Icon{...}

Source: kiln/icon.odin:49

ICON_CHEVRON_RIGHT :: Icon{...}

Source: kiln/icon.odin:52

ICON_CHEVRON_UP :: Icon{...}

Source: kiln/icon.odin:46

ICON_CLOSE :: Icon{...}

Source: kiln/icon.odin:40

ICON_EYE :: Icon{...}

Source: kiln/icon.odin:73

ICON_EYE_OFF :: Icon{...}

Source: kiln/icon.odin:76

ICON_MENU :: Icon{...}

Source: kiln/icon.odin:55

ICON_MINUS :: Icon{...}

Source: kiln/icon.odin:64

ICON_MORE :: Icon{...}

Source: kiln/icon.odin:58

ICON_PLUS :: Icon{...}

Source: kiln/icon.odin:61

ICON_SEARCH :: Icon{...}

Source: kiln/icon.odin:67

ICON_STAR :: Icon{...}

Source: kiln/icon.odin:79