How to make a solid shader in blender?
The slight deviation in color is caused by dithering. If you want to save accurate values for non-color data, then you have to:

Set Dither to zero in Output Properties &gt; Post Processing when you intend to save an 8-bit image

Use one of the following options: Set the View Transform to Raw, disable Save As Render in the file browser or save as OpenEXR to by pass the color management. The latter is the best approach since OpenEXR can store the actual scene linear values.