Skip to Content
defold-typescript libraries
Pause-Gamesflow

Pause-Games/flow/flow.color

Color parsing and normalized hexadecimal color helpers for Flow.

  • GitHub: Pause-Games/flow — pinned to 1.0.0
    1. Pick a release from Pause-Games/flow releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Run bunx @defold-typescript/cli resolve to materialize its types.
    3. Import it under a namespace alias of your choice:
      import * as color from "flow.color"

Functions

rgb(r: number, g: number, b: number): Flow_ColorValue

Creates an opaque hexadecimal color from normalized or byte-valued channels.

Parameters

  • r: number
  • g: number
  • b: number

Returns

  • Flow_ColorValue

rgba(r: number, g: number, b: number, a: number): Flow_ColorValue

Creates a hexadecimal color from normalized or byte-valued channels.

Parameters

  • r: number
  • g: number
  • b: number
  • a: number

Returns

  • Flow_ColorValue

hex(value: string): Flow_ColorValue

Normalizes a hexadecimal color in #RGB, #RGBA, #RRGGBB, or #RRGGBBAA form.

Parameters

  • value: string

Returns

  • Flow_ColorValue

with_alpha(value: Flow_ColorValue, alpha: number): Flow_ColorValue

Returns a color with a replaced alpha channel.

Parameters

  • value: Flow_ColorValue
  • alpha: number

Returns

  • Flow_ColorValue

parse(value: Flow_ColorValue): FlowColor

Parses a hexadecimal or CSS named color into normalized channels.

Parameters

  • value: Flow_ColorValue

Returns

  • FlowColor

resolve(value: Flow_ColorValue): Vector4

Resolves a hexadecimal or CSS named color to a Defold vector.

Parameters

  • value: Flow_ColorValue

Returns

  • Vector4

Types

FlowColorModule

FlowColorModule.__call(r: number, g: number, b: number, a?: number): Flow_ColorValue

Creates a hexadecimal color from normalized or byte-valued channels.

Parameters

  • r: number
  • g: number
  • b: number
  • a?: number

Returns

  • Flow_ColorValue

FlowColor

FlowColor.r: number

The red channel.

FlowColor.g: number

The green channel.

FlowColor.b: number

The blue channel.

FlowColor.a: number

The alpha channel.

On this page