theme

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 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 theme turns Planck's design tokens into a MyGo theme, and registers the brand fonts and icons the client draws with.

Index

Constants

View Source
const (
	SpaceHair      float32 = 2
	Space1         float32 = 4
	Space2         float32 = 8
	Space3         float32 = 12
	Space4         float32 = 16
	Space5         float32 = 24
	Space6         float32 = 32
	Space7         float32 = 48
	SpaceSection   float32 = 96
	SpaceSectionLg float32 = 160
	SizeTargetMin  float32 = 24
	SizeControl    float32 = 32
	SizeControlLg  float32 = 40
	SizeRow        float32 = 64
	SizeIcon       float32 = 16
	SizeIconLg     float32 = 20
	SizeSidebar    float32 = 224
	SizeContainer  float32 = 1200
	SizeRail       float32 = 88
	SizeRailButton float32 = 56
	SizeRailIcon   float32 = 24
	RadiusXs       float32 = 3
	RadiusSm       float32 = 6
	RadiusMd       float32 = 10
	RadiusPill     float32 = 999
)

Space, size and radius in px.

View Source
const (
	TextMicro      float32 = 9
	LeadingMicro   float32 = 12
	TextMini       float32 = 10
	LeadingMini    float32 = 14
	TextCaption    float32 = 11
	LeadingCaption float32 = 16
	TextBody       float32 = 13
	LeadingBody    float32 = 20
	TextTitle      float32 = 16
	LeadingTitle   float32 = 24
	TextHeading    float32 = 20
	LeadingHeading float32 = 28
	TextDisplay    float32 = 25
	LeadingDisplay float32 = 32
	TextReadout    float32 = 31
	LeadingReadout float32 = 36
	TextPin        float32 = 39
	LeadingPin     float32 = 44
)

Type: app scale, size and line height in px.

View Source
const (
	FontDisplay = "Archivo Expanded"
	FontUI      = "Archivo"
	FontMono    = "Martian Mono"
)

Font families as registered with ui.RegisterFont from the static instances in fonts/static.

View Source
const (
	DurFast    float32 = 90
	DurBase    float32 = 160
	DurExit    float32 = 110
	DurStagger float32 = 18
)

Motion, in milliseconds.

Variables

View Source
var (
	Mark        = mustSVG("icons/planck-mark-glyph.svg")
	IconHosts   = mustSVG("icons/ui-hosts.svg")
	IconPairing = mustSVG("icons/ui-pairing.svg")
	IconSetting = mustSVG("icons/ui-settings.svg")
	IconHosting = mustSVG("icons/ui-hosting.svg")
	IconChevron = mustSVG("icons/ui-chevron-down.svg")
	IconEdit    = mustSVG("icons/ui-edit.svg")

	IconFullscreen   = mustSVG("icons/ui-fullscreen.svg")
	IconImmersive    = mustSVG("icons/ui-immersive.svg")
	IconCursor       = mustSVG("icons/ui-cursor.svg")
	IconDirect       = mustSVG("icons/ui-direct.svg")
	IconDisplay      = mustSVG("icons/ui-display.svg")
	IconResolution   = mustSVG("icons/ui-resolution.svg")
	IconCodec        = mustSVG("icons/ui-codec.svg")
	IconColor        = mustSVG("icons/ui-color.svg")
	IconFrameRate    = mustSVG("icons/ui-framerate.svg")
	IconBitrate      = mustSVG("icons/ui-bitrate.svg")
	IconVSync        = mustSVG("icons/ui-vsync.svg")
	IconSound        = mustSVG("icons/ui-sound.svg")
	IconClipboard    = mustSVG("icons/ui-clipboard.svg")
	IconMetrics      = mustSVG("icons/ui-metrics.svg")
	IconHide         = mustSVG("icons/ui-hide.svg")
	IconPower        = mustSVG("icons/ui-power.svg")
	IconChevronRight = mustSVG("icons/ui-chevron-right.svg")
	IconClose        = mustSVG("icons/ui-close.svg")

	IconStatisticsNav = mustSVG("icons/ui-statistics-24.svg")
	IconStatistics    = mustSVG("icons/ui-statistics.svg")
	IconPrompt        = mustSVG("icons/ui-prompt.svg")
	IconSearch        = mustSVG("icons/ui-search.svg")
	IconReset         = mustSVG("icons/ui-reset.svg")
	IconLock          = mustSVG("icons/ui-lock.svg")
	IconShieldCheck   = mustSVG("icons/ui-shield-check.svg")
	IconWarning       = mustSVG("icons/ui-warning.svg")
	IconInfo          = mustSVG("icons/ui-info.svg")
)

Icons are parsed once: MyGo caches SVGs by identity.

View Source
var (
	HUDGlass     = ui.RGBA(14, 15, 18, 0.92)    // panels, the button hovered, the toast
	HUDGlassIdle = ui.RGBA(14, 15, 18, 0.55)    // the button at rest
	HUDGlassTab  = ui.RGBA(14, 15, 18, 0.82)    // the docked edge tab
	HUDEdge      = ui.RGBA(242, 239, 234, 0.10) // hairline
	HUDEdgeLit   = ui.RGBA(242, 239, 234, 0.18) // hovered, dragged or popped out
	HUDDivider   = ui.RGBA(242, 239, 234, 0.08) // inside a panel
	HUDRowHover  = ui.RGBA(242, 239, 234, 0.06) // a menu row under the pointer, an open row
	HUDTray      = ui.RGBA(242, 239, 234, 0.04) // an inline picker tray
	HUDTrace     = ui.RGBA(255, 122, 31, 0.55)  // the line left on the edge by a popped-out button
	HUDDockGlow  = ui.RGBA(255, 122, 31, 0.30)  // the dock target's wash while dragging
)

Overlay chrome over live video, without backdrop blur: the alpha does the blur's work.

View Source
var (
	Carbon950         = ui.Hex("#07080A")
	Carbon900         = ui.Hex("#0E0F12")
	Carbon850         = ui.Hex("#14161A")
	Carbon800         = ui.Hex("#1B1D22")
	Carbon750         = ui.Hex("#22252B")
	Carbon700         = ui.Hex("#2C3038")
	Carbon600         = ui.Hex("#3A3F49")
	Carbon500         = ui.Hex("#5A606C")
	Carbon400         = ui.Hex("#6E7480")
	Bone50            = ui.Hex("#F2EFEA")
	Bone300           = ui.Hex("#B6B8BE")
	Bone400           = ui.Hex("#8C919B")
	BoneLightGround   = ui.Hex("#F6F5F2")
	BoneLightSurface  = ui.Hex("#FFFFFF")
	BoneLightBorder   = ui.Hex("#DAD8D3")
	BoneLightText     = ui.Hex("#0E0F12")
	BoneLightText2    = ui.Hex("#4E535C")
	Ember300          = ui.Hex("#FFB27A")
	Ember400          = ui.Hex("#FF9447")
	Ember500          = ui.Hex("#FF7A1F")
	Ember600          = ui.Hex("#E8650C")
	Ember700          = ui.Hex("#A84603")
	EmberInk          = ui.Hex("#1A0B02")
	SignalDirect      = ui.Hex("#4CD69B")
	SignalRelay       = ui.Hex("#F2C94C")
	SignalFault       = ui.Hex("#FF5A5A")
	SignalDirectLight = ui.Hex("#13804F")
	SignalRelayLight  = ui.Hex("#8A6400")
	SignalFaultLight  = ui.Hex("#C42B2B")
	SpectrumK2000     = ui.Hex("#FF8912")
	SpectrumK3000     = ui.Hex("#FFB46B")
	SpectrumK4000     = ui.Hex("#FFD1A3")
	SpectrumK6500     = ui.Hex("#FFF9FD")
	SpectrumK10000    = ui.Hex("#C9D9FF")
)

Colour primitives.

View Source
var (
	RoleGround        = Carbon900
	RoleWell          = Carbon950
	RoleSurface       = Carbon850
	RoleRaised        = Carbon800
	RoleHover         = Carbon750
	RoleBorder        = Carbon700
	RoleBorderStrong  = Carbon600
	RoleText          = Bone50
	RoleText2         = Bone300
	RoleText3         = Bone400
	RoleAccent        = Ember500
	RoleAccentHover   = Ember400
	RoleAccentPressed = Ember600
	RoleOnAccent      = EmberInk
	RoleFocus         = Ember300
	RoleDirect        = SignalDirect
	RoleRelay         = SignalRelay
	RoleFault         = SignalFault
	RoleControlEdge   = Carbon400
)

Roles. Widgets use only these.

View Source
var FloatShadow = ui.RGBA(0, 0, 0, 0.55)

FloatShadow is the one shadow, for things that float over content.

Functions

func Planck

func Planck() *ui.Theme

Planck returns the client's theme: dark only, built from the role tokens so MyGo's stock widgets (switches, sliders, inputs) match.

func RegisterFonts

func RegisterFonts() error

RegisterFonts registers Archivo, Archivo Expanded and Martian Mono with MyGo under FontUI, FontDisplay and FontMono. Call it once at start-up, before the first window opens; later calls return the first result.

Types

This section is empty.

Jump to

Keyboard shortcuts

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