If I input a color in a color ramp, and set the ramp to constant, the colors do not come out exactly like the input. They are grayer/darker.
Example:
On my color ramp, the yellow input is "#FFF763", but the output is "#cecb6d"
By default blender tweaks the final renders colors.
Go to the Render Properties tab (camera), and under Color Management, change View Transform from Filmic to Standard. Now the colors will come out nearly identical.