Skip to content
Naming conventions

Naming conventions

Syntax

Tip

For ease of understanding, this wiki introduces a special syntax for some elements.

Optional parameters

Text followed by a question mark (?) indicates that the parameter is optional and may be omitted. If the question mark is followed by = data_type/= value, this means that the parameter can only take the specified data type or defaults to the specified value.

Example

hl.dsp.window.float({ window?, action? }) means that window and action are not required. The dispatcher will use their default values instead: the currently active window, and an action of "toggle".

Value ranges

[value1 - value2] means a range of values from value1 to value2 with respect to the type. If one of the limits is not specified, it is substituted with ....

Examples

[0.25 - 5.0] means all floating numbers from 0.25 to 5.0 are allowed.
[0 - ...] means all int values from 0 to your machine’s int limit are allowed.

Coordinates

Coordinates are in an inverse-Y Cartesian system, so moving to the right is the positive X direction (+x), and moving downward is the positive Y direction (+y).

Data types

typedescription
intInteger number
floatFloating point number
boolBoolean, true or false
stringLua string. Symbols wrapped in ""/''/[[]] (e.g., "dwindle", 'master', [[scrolling]]). When using Lua literal strings ([[]]), escaping of " and ' is not needed
tableA Lua table, { }
vec2Vector with 2 float values. {x, y} (e.g., {20, 20})
css_gapsAn integer, or { top?, left?, right?, bottom? }
colorColor. See hint below for color info
gradientA gradient, will accept a color, or { colors = { color, color }, angle? = float } structure
font_weightAn integer between 100 and 1000, or one of the following presets: thin (100) ultralight (200) light (300) semilight (350) book (380) normal (400) medium (500) semibold (600) bold (700) ultrabold (800) heavy (900) ultraheavy (1000)

There are implicit conversions between certain types, however, this may lead to undefined behavior later. LSP with Lua stub can be used to warn about the use of wrong types. More on that can be read here.

Colors

You have 4 options:

  • Web-styled hash in RGB or RGBA form: "#FAFC32" or "#DDD" or "#FA3D7BFF"
  • rgba(): "rgba(57BBFFEE)", or decimal equivalent "rgba(87,187,255,0.933)"
  • rgb(): "rgb(FF4410)", or decimal equivalent "rgb(255,68,16)"
  • Legacy ARGB format: "0xeeb3ff1a"

Note that decimal arguments in rgb()/rgba() should have no spaces between them.

Last updated on