Overview
Add a bgcolorEnd option that interpolates the overlay's background color from bgcolor toward bgcolorEnd as progress increases from 0 to 100.
Proposed API
// Vanilla
Loadgo.init(el, {
bgcolor: '#FF0000', // red at 0%
bgcolorEnd: '#00FF00', // green at 100%
})
// jQuery
$('#logo').loadgo({
bgcolor: '#FF0000',
bgcolorEnd: '#00FF00',
})
Behaviour
- When
bgcolorEnd is set, each setprogress call linearly interpolates the overlay's backgroundColor between bgcolor (at 0%) and bgcolorEnd (at 100%).
- When
bgcolorEnd is not set (default null), behaviour is unchanged — overlay color stays fixed at bgcolor.
- Interpolation operates in RGB space on each channel independently.
- Both hex (
#RRGGBB) and rgb(r, g, b) formats should be accepted for both bgcolor and bgcolorEnd.
- Not applicable in
filter mode (no overlay exists); option is ignored in that case.
Motivation
Enables at-a-glance progress feedback through color without requiring custom CSS or an onProgress callback:
- Red → green for success indicators
- White → brand color for reveal effects
Notes
- Both
loadgo.js (jQuery) and loadgo-vanilla.js should be updated.
- Composable with
animated / animationDuration — the CSS transition on the overlay already covers background-color if added to the transition property list.
Overview
Add a
bgcolorEndoption that interpolates the overlay's background color frombgcolortowardbgcolorEndas progress increases from 0 to 100.Proposed API
Behaviour
bgcolorEndis set, eachsetprogresscall linearly interpolates the overlay'sbackgroundColorbetweenbgcolor(at 0%) andbgcolorEnd(at 100%).bgcolorEndis not set (defaultnull), behaviour is unchanged — overlay color stays fixed atbgcolor.#RRGGBB) andrgb(r, g, b)formats should be accepted for bothbgcolorandbgcolorEnd.filtermode (no overlay exists); option is ignored in that case.Motivation
Enables at-a-glance progress feedback through color without requiring custom CSS or an
onProgresscallback:Notes
loadgo.js(jQuery) andloadgo-vanilla.jsshould be updated.animated/animationDuration— the CSStransitionon the overlay already coversbackground-colorif added to the transition property list.