wordle/styles.go

46 lines
1.0 KiB
Go

package main
import "github.com/charmbracelet/lipgloss"
var width = 30
// ---- colours ----
var colorGrey = lipgloss.AdaptiveColor{Light: "8", Dark: "7"}
// ---- main game ----
// the title of the game (i.e. wordle #123)
var headerStyle = lipgloss.NewStyle().
Foreground(colorGrey).
Italic(true).
Align(lipgloss.Center).
Width(width)
// the bit where you type in the word
var promptStyle = lipgloss.NewStyle().
Foreground(lipgloss.Color("12")).
Align(lipgloss.Center).
Width(width)
// the line of letters
var lineStyle = lipgloss.NewStyle().Width(width).Align(lipgloss.Center)
// empty space or character not in word
var charEmptyStyle = lipgloss.NewStyle().
Foreground(colorGrey)
// character in wrong position
var charWrongPositionStyle = charEmptyStyle.Copy().
Foreground(lipgloss.Color("11"))
// character in correct position
var charCorrectStyle = charEmptyStyle.Copy().
Foreground(lipgloss.Color("10"))
var errorStyle = lipgloss.NewStyle().
Foreground(lipgloss.Color("9")).
Italic(true).
Align(lipgloss.Center).
Width(width)