The optical continuum of solar and stellar flares