britzldefold-richtext
britzl/defold-richtext/richtext.color
Rich-text rendering for Defold: styled spans, embedded tags, and per-color text runs.
- GitHub: britzl/defold-richtext — pinned to
5.22.1- Pick a release from britzl/defold-richtext releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as color from "richtext.color"
- Pick a release from britzl/defold-richtext releases and add its Source code (zip) URL (or a packaged
Functions
add(name: string, color: number | string)
Parameters
name:stringcolor:number | string
parse(c: string): Vector4 | undefined
Resolves a color by name, hex string or comma-separated decimal string.
Parameters
c:string
Returns
Vector4 | undefined
parse_hex(hex: string): Vector4 | undefined
Parses a #rrggbb or #rrggbbaa hex string, with or without the leading #.
Parameters
hex:string
Returns
Vector4 | undefined
parse_decimal(dec: string): Vector4 | undefined
Parses a comma-separated r,g,b,a string of decimal components.
Parameters
dec:string
Returns
Vector4 | undefined