parse
On this page
wakterm.color.parse(string)#
Parses the passed color and returns a Color
object. Color objects evaluate as strings but
have a number of methods that allow transforming and comparing
colors.
> wakterm.color.parse("black")
#000000
This example picks a foreground color, computes its complement in the "artist's color wheel" to produce a purple color and then darkens it to use it as a background color:
local wakterm = require 'wakterm'
local fg = wakterm.color.parse 'yellow'
local bg = fg:complement_ryb():darken(0.2)
return {
colors = {
foreground = fg,
background = bg,
},
}