functions

Background
Edited: Sunday 25 January 2026

Background

Category: Atoms
File: atoms.go
Package: ui

Signature

1func Background(background color.NRGBA, w W) W

Description

Background fills the area behind a widget with the specified color.
The background extends to cover the widget’s full dimensions.

Example:

redBackground := Background(color.NRGBA{R: 255, A: 255}, Label("Red bg"))

This is a fundamental building block for creating colored containers and panels.

Examples

Background

1{
2	redBg := Background(
3		color.NRGBA{R: 255, A: 255},
4		Label("Red background"),
5	)
6	_ = redBg
7}

Example Output


This documentation is auto-generated. To update, run make docs

Backlinks