From 597303bc48148231175c482fb74ed85797c79d29 Mon Sep 17 00:00:00 2001 From: Kai O'Reilly Date: Sat, 28 Dec 2024 21:09:05 -0800 Subject: [PATCH] start on style color images docs --- docs/content/styles.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/content/styles.md b/docs/content/styles.md index 348f6d50d..22dd0b565 100644 --- a/docs/content/styles.md +++ b/docs/content/styles.md @@ -47,7 +47,7 @@ bt.Styler(func(s *styles.Style) { }) ``` -Note that the color is wrapped in [[doc:colors.Uniform]]. That is because all colors in Cogent Core are specified as images, which allows for easy use of [[#gradient]]s and [[#background image]]s. For the [[#color scheme]] above, scheme colors are automatically converted to images, so you don't need to use colors.Uniform. You can use [[doc:colors.ToUniform]] to convert a scheme color back from an image to a color. +Note that the color is wrapped in [[doc:colors.Uniform]]. That is because all colors in Cogent Core are specified as images, which allows for easy use of [[#gradient]]s and background [[#image]]s. For the [[#color scheme]] above, scheme colors are automatically converted to images, so you don't need to use colors.Uniform. You can use [[doc:colors.ToUniform]] to convert a scheme color back from an image to a color. Named colors do not adjust to light/dark mode and user [[settings]], so you should use the [[#color scheme]] instead when possible. However, if you do need colors outside of the color scheme, you can use color normalization functions as explained below. @@ -98,3 +98,7 @@ fr.Styler(func(s *styles.Style) { s.Min.Set(units.Em(5)) }) ``` + +### Images + +You can use any image as a color, including all those supported by the [[image]] widget.