Kistan 2.0 Doc
  • Furniture
  • Sound cables
  • Roof LED
  • Pipes
  • Inputs/Outputs
  • Mixer
  • Amplifiers
  • DALI
  • DMX
  • Roof LED
  • LMixer
  • Sound mixer defaults
  • Bar computer to Kitchen speakers
  • Server: IN-SMN
  • Server: IN-ITK
  • SSO / Login
  • Grafana
IT-Sektionen
  • Furniture
  • Sound cables
  • Roof LED
  • Pipes
  • Inputs/Outputs
  • Mixer
  • Amplifiers
  • DALI
  • DMX
  • Roof LED
  • LMixer
  • Sound mixer defaults
  • Bar computer to Kitchen speakers
  • Server: IN-SMN
  • Server: IN-ITK
  • SSO / Login
  • Grafana
IT-Sektionen
  • LMixer

    • LMixer
    • LMixer scripting
    • Mixing technique
    • LMixer examples
    • LMixer Addons

      • Addons
      • Addon Development
      • Built-in addons
      • Kistan Specific Addons
      • LMixer Addon Suite

        • Addon Suite
        • Effects
        • Addon Suite Extensions
        • Utility Functions
    • Reference

      • Layers in kistan
      • Macros
      • Fixture Types in Kistan
      • Fixtures in Kistan's LMixer
      • Fixture Config File
    • LMixer Technical Info

      • Technical LMixer Info
      • MQTT Topics
      • Compatibility

Utility Functions

Location: addon_suite/util

Color

Location: addon_suite/util/color

There are two types of color used, RGBColor and ColorTable. The former is preferred, as ColorTable is deprecated.

RGBColor

Example: Create Laser violet as an RGBColor

local laserViolet = {
    r = 204,
    g = 153,
    b = 255
}

to_rgb

Converts a color to RGBColor

Arguments

namedescription
valueA hex code or ColorTable

Example: Create Laser violet as an RGBColor

local laserViolet = to_rgb(0xcc99ff)

hue_to_rgb

Arguments:

namedescription
hueThe hue of the color, 0-360
intensityThe intensity of the color, 0 - 255

Converts a hue to an RGBColor. This is currently not exact, and is subject to change the internal math.

color_lerp

namedescription
colAThe starting Color
colBThe ending color
lerpValueThe position along the lerp, 0=A, 1=B

color_to_srgb

Converts a RGBColor to be interpreted in srgb. Useful for displaying in linear color gammas - such as LEDs.

hex_to_srgb

Same as color_to_srgb, except it takes in a hex value

Example: Make the sign laser violet

local laserViolet = hex_to_srgb(0xcc99ff)
sign:add(0, set(laserViolet.r, laserViolet.g, laserViolet.g))

Deprecated

The following is deprecated and should be avoided

ColorTable

Example: Create Laser violet as an ColorTable

local laserViolet = {
    204,
    153,
    255
}

rgb_color_to_rgb_table

Converts RGBColor to ColorTable

namedescription
rgbColorAn RGBColor

Example: Create Laser violet as an ColorTable

local laserViolet = rgb_color_to_rgb_table({
    r = 204,
    g = 153,
    b = 255
})

color_table_to_srgb

Same as color_to_srgb, except with ColorTable instead of RGBColor

color_table_lerp

Same as color_lerp, except with ColorTable instead of RGBColor

color_srgb_table_hex

Same as hex_to_srgb, except with ColorTable instead of RGBColor

Strings

Location: addon_suite/util/strings

pad_number_to_string_length

Pads a string or number to be at least the specified length

Arguments

nameOptionaldescription
valueNoThe string or number
lengthNoThe minimum length
paddingYesThe padding string, defaults to 0
Edit this page
Prev
Addon Suite Extensions