gx #
Description
gx was a complementary module to gg, that provided some predefined graphical color names/operations.
Note
gxis now deprecated, and all functionality was merged withgg.
Constants #
@[deprecated: 'use gg.black instead']
@[deprecated_after: '2026-01-24']
const black = gg.black
@[deprecated: 'use gg.gray instead']
@[deprecated_after: '2026-01-24']
const gray = gg.gray
@[deprecated: 'use gg.white instead']
@[deprecated_after: '2026-01-24']
const white = gg.white
@[deprecated: 'use gg.red instead']
@[deprecated_after: '2026-01-24']
const red = gg.red
@[deprecated: 'use gg.green instead']
@[deprecated_after: '2026-01-24']
const green = gg.green
@[deprecated: 'use gg.blue instead']
@[deprecated_after: '2026-01-24']
const blue = gg.blue
@[deprecated: 'use gg.yellow instead']
@[deprecated_after: '2026-01-24']
const yellow = gg.yellow
@[deprecated: 'use gg.magenta instead']
@[deprecated_after: '2026-01-24']
const magenta = gg.magenta
@[deprecated: 'use gg.cyan instead']
@[deprecated_after: '2026-01-24']
const cyan = gg.cyan
@[deprecated: 'use gg.orange instead']
@[deprecated_after: '2026-01-24']
const orange = gg.orange
@[deprecated: 'use gg.purple instead']
@[deprecated_after: '2026-01-24']
const purple = gg.purple
@[deprecated: 'use gg.indigo instead']
@[deprecated_after: '2026-01-24']
const indigo = gg.indigo
@[deprecated: 'use gg.pink instead']
@[deprecated_after: '2026-01-24']
const pink = gg.pink
@[deprecated: 'use gg.violet instead']
@[deprecated_after: '2026-01-24']
const violet = gg.violet
@[deprecated: 'use gg.dark_blue instead']
@[deprecated_after: '2026-01-24']
const dark_blue = gg.dark_blue
@[deprecated: 'use gg.dark_gray instead']
@[deprecated_after: '2026-01-24']
const dark_gray = gg.dark_gray
@[deprecated: 'use gg.dark_green instead']
@[deprecated_after: '2026-01-24']
const dark_green = gg.dark_green
@[deprecated: 'use gg.dark_red instead']
@[deprecated_after: '2026-01-24']
const dark_red = gg.dark_red
@[deprecated: 'use gg.light_blue instead']
@[deprecated_after: '2026-01-24']
const light_blue = gg.light_blue
@[deprecated: 'use gg.light_gray instead']
@[deprecated_after: '2026-01-24']
const light_gray = gg.light_gray
@[deprecated: 'use gg.light_green instead']
@[deprecated_after: '2026-01-24']
const light_green = gg.light_green
@[deprecated: 'use gg.light_red instead']
@[deprecated_after: '2026-01-24']
const light_red = gg.light_red
const align_left = gg.HorizontalAlign.left
Todo: remove these, and use the enum everywhere
const align_right = gg.HorizontalAlign.right
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 i32) 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
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.