common

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BlackColor, _ = ParseHexColor("#000")
View Source
var WhiteColor, _ = ParseHexColor("#FFF")

Functions

func Color2RGBA

func Color2RGBA(c color.Color) color.RGBA

func CreateGradient

func CreateGradient(option Gradient, additionalRotation float64,
	x, y, size float64) canvas.Gradient

func ParseHexColor

func ParseHexColor(s string) (c color.RGBA, err error)

Types

type Color

type Color struct {
	ColorType ColorType
	Color     color.Color
	Gradient  Gradient
}

type ColorStop

type ColorStop struct {
	Offset float64
	Color  color.Color
}

type ColorType

type ColorType int
const (
	// SingleColor 单个颜色
	SingleColor ColorType = iota
	// GradientColor 渐变色
	GradientColor
)

func (ColorType) String

func (c ColorType) String() string

type Gradient

type Gradient struct {
	Type       GradientType
	Rotation   float64
	ColorStops []ColorStop
}

type GradientType

type GradientType int
const (
	// Linear 线性渐变
	Linear GradientType = iota
	// Radial 径向渐变
	Radial
	// Repeating 重复渐变
	Repeating
	// Conic 锥形渐变
	Conic
)

func (GradientType) String

func (e GradientType) String() string

Jump to

Keyboard shortcuts

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