calendar

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package calendar draws a one-month calendar grid into a pixel buffer. It is used for the popup shown while the pointer hovers the clock module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Draw

func Draw(pix []byte, w, h, stride, scale, radius int32, faces *render.FaceSet, now time.Time, col Colors)

Draw paints the calendar for now's month onto the physical pixel buffer (BGRA8888, stride = w*4). The current day is highlighted. radius (logical pixels) rounds the corners; 0 keeps the square box.

func Size

func Size(scale int32) (w, h int32)

Size returns the popup's physical pixel dimensions at the given output scale.

Types

type Colors

type Colors struct {
	Bg      color.RGBA // panel background
	Fg      color.RGBA // weekday numbers and the month header
	Muted   color.RGBA // weekday letter row
	Border  color.RGBA // frame + separator line
	Today   color.RGBA // highlight behind today's number
	TodayFg color.RGBA // today's number, drawn on the highlight
	Weekend color.RGBA // Saturday/Sunday numbers
}

Colors are the palette the calendar paints with; the caller derives these from the bar theme.

Jump to

Keyboard shortcuts

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