Source File
sketch_overlay.go
Belonging Package
oss.terrastruct.com/d2/d2themes
package d2themesimport ()type ThemableSketchOverlay struct {el *ThemableElementfill string}func ( *ThemableElement, string) *ThemableSketchOverlay {return &ThemableSketchOverlay{,,}}// TODO we can just call el.Copy() to prevent that// WARNING: Do not reuse the element afterwards as this function changes the Class propertyfunc ( *ThemableSketchOverlay) () (string, error) {if color.IsThemeColor(.fill) {.el.ClassName += fmt.Sprintf(" sketch-overlay-%s", .fill) // e.g. sketch-overlay-B3} else {, := color.LuminanceCategory(.fill)if != nil {return "",}.el.ClassName += fmt.Sprintf(" sketch-overlay-%s", ) // e.g. sketch-overlay-dark}return .el.Render(), nil}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |