gx #
Description
gx
is a complementary module to gg
, that just provides some predefined graphical color names/operations.
Note >
gx
is going to be merged withgg
soon.
Constants #
const align_right = HorizontalAlign.right
const align_left = HorizontalAlign.left
Todo: remove these, and use the enum everywhere
const light_red = gg.light_red
const light_green = gg.light_green
const light_gray = gg.light_gray
const light_blue = gg.light_blue
const dark_red = gg.dark_red
const dark_green = gg.dark_green
const dark_gray = gg.dark_gray
const dark_blue = gg.dark_blue
const violet = gg.violet
const pink = gg.pink
const indigo = gg.indigo
const purple = gg.purple
const orange = gg.orange
const cyan = gg.cyan
const magenta = gg.magenta
const yellow = gg.yellow
const blue = gg.blue
const green = gg.green
const red = gg.red
const white = gg.white
const gray = gg.gray
const black = gg.black
fn color_from_string #
deprecated: use gg.color_from_string instead
deprecated_after: 2026-01-24
fn color_from_string(s string) Color
color_from_string returns a Color, corresponding to the given string or black Color if string is not found in lookup table, or a hex color if starting with #
fn hex #
deprecated: use gg.hex instead
deprecated_after: 2026-01-24
fn hex(color int) Color
hex takes in a 32 bit integer and splits it into 4 byte values
fn rgb #
deprecated: use gg.rgb instead
deprecated_after: 2026-01-24
fn rgb(r u8, g u8, b u8) Color
rgb builds a Color instance from given r, g, b values
fn rgba #
deprecated: use gg.rgba instead
deprecated_after: 2026-01-24
fn rgba(r u8, g u8, b u8, a u8) Color
rgba builds a Color instance from given r, g, b, a values
type Color #
type Color = gg.Color
Color represents a 32 bit color value in sRGB format
type HorizontalAlign #
type HorizontalAlign = gg.HorizontalAlign
type TextCfg #
type TextCfg = gg.TextCfg
type VerticalAlign #
type VerticalAlign = gg.VerticalAlign
struct Image #
@[deprecated: 'use gg.Image']
@[deprecated_after: '2026-01-24']
struct Image {
mut:
obj voidptr
pub:
id int
width int
height int
}
fn (Image) is_empty #
fn (i Image) is_empty() bool
is_empty returns true if the Image i
is empty.