From QGIS 3.18 it is possible to add raster legends with colour ramps in an easy way. The video demonstrates the settings of the new functionality.I was happy to fund this feature that was implemented by Nyall Dawson.