All nUI does is set the Alpha value to the cooldown layer.
I'm not sure how useful this will be for you but this is some code from nUI that uses cooldowns on its buttons
Lua Code:
function nUI_ButtonBars:createBar( name, layout )
local bar = CreateFrame( "Frame", name, nUI_Dashboard.Anchor, "SecureHandlerStateTemplate,SecureHandlerAttributeTemplate" );
local id = (rowsloop - 1) * layout.cols + colsloop;
local button = CreateFrame( "CheckButton", "$parent_Button"..id, bar, "ActionBarButtonTemplate" );
..
nUI:initActionButton( button );
..
end
function nUI:initActionButton( button )
local btn_name = button:GetName()
local overlay = CreateFrame( "Frame", "$parent_ActionOverlay", button );
...
overlay.layers.cooldown = _G[btn_name.."Cooldown"]
...
overlay.layers.cooldown:SetAlpha( 1 )
...
end
This is Blizzards Button code .. in the UpdateCooldown function there are some code blocks regarding set up of the swipe texture. They don't use the alpha fading on that itself though.
https://www.townlong-yak.com/framexm...tionButton.lua