gx #

Constants #

const (
	blue        = Color{
		r: 0
		g: 0
		b: 255
	}
	red         = Color{
		r: 255
		g: 0
		b: 0
	}
	green       = Color{
		r: 0
		g: 255
		b: 0
	}
	yellow      = Color{
		r: 255
		g: 255
		b: 0
	}
	orange      = Color{
		r: 255
		g: 165
		b: 0
	}
	purple      = Color{
		r: 128
		g: 0
		b: 128
	}
	black       = Color{
		r: 0
		g: 0
		b: 0
	}
	gray        = Color{
		r: 128
		g: 128
		b: 128
	}
	indigo      = Color{
		r: 75
		g: 0
		b: 130
	}
	pink        = Color{
		r: 255
		g: 192
		b: 203
	}
	violet      = Color{
		r: 238
		g: 130
		b: 238
	}
	white       = Color{
		r: 255
		g: 255
		b: 255
	}
	dark_blue   = Color{
		r: 0
		g: 0
		b: 139
	}
	dark_gray   = Color{
		r: 169
		g: 169
		b: 169
	}
	dark_green  = Color{
		r: 0
		g: 100
		b: 0
	}
	dark_red    = Color{
		r: 139
		g: 0
		b: 0
	}
	light_blue  = Color{
		r: 173
		g: 216
		b: 230
	}
	light_gray  = Color{
		r: 211
		g: 211
		b: 211
	}
	light_green = Color{
		r: 144
		g: 238
		b: 144
	}
	light_red   = Color{
		r: 255
		g: 204
		b: 203
	}
)

fn color_from_string #

fn color_from_string(s string) Color

fn hex #

fn hex(color int) Color

hex takes in a 32 bit integer and splits it into 4 byte values

fn rgb #

fn rgb(r byte, g byte, b byte) Color

fn rgba #

fn rgba(r byte, g byte, b byte, a byte) Color

enum HorizontalAlign #

enum HorizontalAlign {
	left = C.FONS_ALIGN_LEFT
	center = C.FONS_ALIGN_CENTER
	right = C.FONS_ALIGN_RIGHT
}

enum VerticalAlign #

enum VerticalAlign {
	top = C.FONS_ALIGN_TOP
	middle = C.FONS_ALIGN_MIDDLE
	bottom = C.FONS_ALIGN_BOTTOM
	baseline = C.FONS_ALIGN_BASELINE
}

struct Color #

struct Color {
pub mut:
	r byte
	g byte
	b byte
	a byte = 255
}

Color represents a 32 bit color value in sRGB format

fn (Color) + #

fn (c Color) + (c2 Color) Color

fn (Color) - #

fn (c Color) - (c2 Color) Color

fn (Color) * #

fn (c Color) * (c2 Color) Color

fn (Color) / #

fn (c Color) / (c2 Color) Color

fn (Color) eq #

fn (c Color) eq(c2 Color) bool

fn (Color) str #

fn (c Color) str() string

fn (Color) rgba8 #

fn (c Color) rgba8() int

rgba8 - convert a color value to an int in the RGBA8 order. see https://developer.apple.com/documentation/coreimage/ciformat

fn (Color) bgra8 #

fn (c Color) bgra8() int

bgra8 - convert a color value to an int in the BGRA8 order. see https://developer.apple.com/documentation/coreimage/ciformat

fn (Color) abgr8 #

fn (c Color) abgr8() int

abgr8 - convert a color value to an int in the ABGR8 order. see https://developer.apple.com/documentation/coreimage/ciformat

struct Image #

struct Image {
mut:
	obj voidptr
pub:
	id     int
	width  int
	height int
}

fn (Image) is_empty #

fn (i Image) is_empty() bool

struct TextCfg #

struct TextCfg {
pub:
	color          Color = black
	size           int   = 16
	align          HorizontalAlign = .left
	vertical_align VerticalAlign   = .top
	max_width      int
	family         string
	bold           bool
	mono           bool
	italic         bool
}