utils.lua
utils.lua
util = require 'aegisub.util'
util
newtable = util.copy(oldtable)
deep_copy
newtable = util.deep_copy(oldtable)
ass_color
colorstring = util.ass_color(r, g, b)
ass_alpha
alphastring = util.ass_alpha(a)
ass_style_color
colorstring = util.ass_style_color(r, g, b, a)
&HAABBGGRR.
extract_color
r, g, b, a = util.extract_color(colorstring)
&HAABBGGRR&HBBGGRR&&HAA&#RRGGBBAA
nil
r, g, b, a = extract_color("&H7F&")
r, g, and
b will be 0; a will be
127.
alpha_from_style
alphastring = util.alpha_from_style(coloralphastring)
color_from_style
colorstring = util.color_from_style(coloralphastring)
HSV_to_RGB
r, g, b = util.HSV_to_RGB(h, s, v)
string.trim
outstring = util.trim(instring)
%s
string.headtail
head, tail = util.headtail(instring)
instringinstring, "".
string.words
for word in util.words(instring) do ... end
outval = util.clamp(inval, min, max)
invalmin..max.
outval = util.interpolate(t, a, b)
interpolate_color
outcolor = util.interpolate_color(t, color1, color2)
interpolate_alpha
outalpha = util.interpolate_alpha(t, alpha1, alpha2)
interpolate_color