User Tools

Site Tools


This is an old revision of the document!

gui (Module)

Utilities for GUI applications.

setDefaults ( d : Record )

Populate record d with the default configuration variables for a GUI app.

scale ( value, factor : Number )

Scales a value by factor. If value is a text string, the suffixes “pt” and “px” (point, pixel) are retained in the result.

Value to scale. Number or Text, may have “pt” or “px” as suffix.
Scale factor.

colorMix ( a, b, amount : Number )

Returns a color where vectors a and b are interpolated by amount. If amount is 0, the result is a; if amount is 1, the result is b.

colorAlpha (colorVector, alpha : Number)

Returns a new color with the alpha value changed to alpha.

def dpiScaledImagePath(path)

  # Returns a version of 'path' where "@2x" is appended to the end
  # if PIXEL_RATIO is 2 (approximately).
script/module/gui.1574012972.txt.gz · Last modified: 2019-11-17 19:49 by skyjake