AviSynth/AviSynthPlus

AddBorders with rgba color value

seiya-git opened this issue · 1 comments

Hello. AddBorders accept only rgb value or rgba accepted too?

https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/addborders.html
there is only color but no colors value

Yes, RGBA is accepted too, at least if you use four-byte hex values instead of the three that colors_rgb.avsi defines for the color presets.

$48D1CC is medium turquoise, standard RGB
$0048D1CC is medium turquoise, RGBA with the alpha channel invisible (in ffplay or mpv, this will appear black or as the checkerboard transparency placeholder)
$FF48D1CC is medium turquoise, RGBA with the alpha channel visible ()

left=ColorBars(pixel_type="RGBP").AddAlphaPlane().Crop(0,0,-320,0).AddBorders(0,32,0,32,color=$0048D1CC)
right=ColorBars(pixel_type="RGBP").AddAlphaPlane().Crop(320,0,0,0).AddBorders(0,32,0,32,color=$FF48D1CC)
StackHorizontal(left,right)

(Note: I have not tested this on a big endian system to verify whether the hex value is interpreted the same way, or if I have tested it, I forgot whether it understands it as the same color or whether you have to use byte-swapped values)