I presume you export your visuals in a certain color profile (typical sRGB) for web.
Unfortuntely most browsers don’t do color management that good, they all interpret color codes differently.
If you would pick a color via a color picker the color will be as interpreted / perceived by the browser / picker. The sampled color will be raw RGB colors or HEX codes.
Whether your images do have a profile or not these colors always will be different on certain devices depending on if the user has a calibrated screen, which browser is used, etc.
So unfortunately there is no real way to match colors of images and rendered browser colors.
But you could make your illustrations transparent PNGs and just pick a background color you like in the row color afterwards. In my opinion that’s the best way to make sure no one sees these broders you screenshotted above.
Transparent PNGs could come with a few functional drawbacks and filesizes can get big pretty fast. You can minify PNG Filesize with ImgAlpha, though.
Hope that helps!