Documentation ¶
Overview ¶
Package rgbatype defines a custom format for RGBA colors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RGBAFormat = gen.CustomFormat[ RGBA, JSONRGBAEncoding, TextRGBAEncoding, ]()
RGBAFormat defines a custom format for RGBA colors.
Functions ¶
This section is empty.
Types ¶
type JSONRGBAEncoding ¶
type JSONRGBAEncoding struct{}
JSONRGBAEncoding defines a custom JSON encoding for RGBA colors.
func (JSONRGBAEncoding) DecodeJSON ¶
func (JSONRGBAEncoding) DecodeJSON(d *jx.Decoder) (v RGBA, _ error)
DecodeJSON decodes an RGBA color from a JSON string.
func (JSONRGBAEncoding) EncodeJSON ¶
func (JSONRGBAEncoding) EncodeJSON(e *jx.Encoder, v RGBA)
EncodeJSON encodes an RGBA color as a JSON string.
type RGBA ¶
type RGBA struct {
R, G, B, A uint8
}
RGBA is a color with red, green, blue, and alpha components.
type TextRGBAEncoding ¶
type TextRGBAEncoding struct{}
TextRGBAEncoding defines a custom text encoding for RGBA colors.
func (TextRGBAEncoding) DecodeText ¶
func (TextRGBAEncoding) DecodeText(s string) (v RGBA, _ error)
DecodeText decodes an RGBA color from a string.
func (TextRGBAEncoding) EncodeText ¶
func (TextRGBAEncoding) EncodeText(v RGBA) string
EncodeText encodes an RGBA color as a string.
Click to show internal directories.
Click to hide internal directories.