##YIYAGTFA##
Ladies and Mentlegen, I introduce you to YIYAGTFA: YIYAGTFA Isn't Yet Another Gradient Tool For Aegisub!
No, wait, I decided to call it ASSgrad.
##ASSgrad!##
And that's because it makes gradients. They are a lot of ASS. Its exciting feature is that it can do diagonal gradients and it supports alpha as well. This is cool, but can mean even more ASS. The amount of ASS generated by this script can make renderers perform like ASS, especially if you're trying to make awesome ASS or avoid banding that totally looks like ASS.
Currently, because I am an ASS, it only works reasonably with vertical color gradients (and only on main and border at that).
Once all the features are usable, however, here is what the interface shall be: at the beginning of the Effect
field of each desired line, enter this: <Ag>(1c:2c:3c:4c;1a:2a:3a:4a;mode.bandSize.bandOverlap.theta.left.top.right.bottom)
where 1c
is a dot delimited list of colors in the format of &HBBGGRR&
or #RRGGBB
, where e.g. BB
is a hexadecimal color value in the range 00โFF
for blue. 1a
is a dot delimited list of alpha values, and must be in decimal format from 0โ255
. ASSgrad will iterate backwards across all of the lines in the script, collecting the ones that match the proper pattern in the Effect
field, namely ^<Ag>\(.+?\)
. It will go through each collected line, creating the gradient for each one, and deleting the relevant contents of the Effect
field. I currently have no plans for a tool to undo gradients, though if the demand is there, I suppose it should be easy enough to write.
The options are as follows:
mode
(unimplemented placeholder for different modes e.g. per-character).bandSize
is the height of one band in pixels. It defaults to 4 pixels.bandOverlap
is the amount of overlap between adjacent bands in pixels. By default it will be set to the same value asbandSize
(that is, its default default is 4 pixels, but if you setBandSize
and notbandOverlap
, thenbandOverlap
will default to whatever you set asBandSize
).theta
(unimplemented placeholder for gradient rotation).left
,top
,right
, andbottom
are manual expansions for the different edges of the line bounding box. You should use them if the line does not fit all the way into the generated clips. Positive values will always cause an expansion, and negative a contraction.
Note: non-\an5 alignments are now supported, but the line size detection needs some work. Use at your own risk.
Oh yeah, and it also requires Aegisub 3.0.0+, because it uses its regular expression engine.
It's okay to neglect unused values, as long as you don't care to set anything after them.
<Ag>(&HFF0000&.&H00FF00&)
is valid, and will create a gradient on color 1, from blue to green.
<Ag>(&HFF0000&.#00FF00;;.10...5)
creates the same gradient as above, but it uses a band size of 10 pixels and has a left side clipbox expansion of 5 pixels. Also note that #
is not required for rgb color formatting (that is, #0000FF
and 0000FF
are equivalent (and also very blue)).
<Ag>(&HFF0000&.&H00FF00&::&H00FF00&.&HFF0000&;:::0.180.255)
should be valid, and will create a gradient on color 1 (main color), from blue to green, a gradient on color 3 (outline), from green to blue, and an alpha gradient on color 4 (shadow) that goes from opaque, to translucent, to fully transparent.
<Ag>(;;.10.5)
will do nothing. (or, well, at this point it may do something because I have not tested this a whole lot.)
And so on.