mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
all: use color.NRGBA in public API
color.RGBA has two problems with regards to using it. First the color values need to be premultiplied, whereas most APIs have non-premultiplied values. This is mainly to preserve color components with low alpha values. Second there are two ways to premultiply with sRGB. One is to premultiply after sRGB conversion, the other is before. This makes using the API more confusing. Using color.NRGBA in sRGB makes it align with CSS.e Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
@@ -18,11 +18,11 @@ type EditorStyle struct {
|
||||
Font text.Font
|
||||
TextSize unit.Value
|
||||
// Color is the text color.
|
||||
Color color.RGBA
|
||||
Color color.NRGBA
|
||||
// Hint contains the text displayed when the editor is empty.
|
||||
Hint string
|
||||
// HintColor is the color of hint text.
|
||||
HintColor color.RGBA
|
||||
HintColor color.NRGBA
|
||||
Editor *widget.Editor
|
||||
|
||||
shaper text.Shaper
|
||||
|
||||
Reference in New Issue
Block a user