How to create color pallet gradient

I was wondering how to creat a color pallet gradient like given image and what should be the file format.
helping hands are much appriciated. thanks in advance.

Unreal supports curve atlases for this purpose, not sure about Unity.

If no such solution is available, use photoshop, give yourself like 128 pixels in x and 4 in y per gradient, export as uncompressed tga or png, import and set to bc1 compression, sRGB enabled.