rgbatype

package
v0.60.0-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package rgbatype defines a custom format for RGBA colors.

Index

Constants

This section is empty.

Variables

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL