That was me with a rich metallic blue colour. I was very lucky, although it cost me well over a tenner to apply one tiny drop of paint. (Glad I did it though!)
I read somewhere that the human eye can detect over one million different colours (especially in the green spectrum). That is why paint that is "almost right" is still visible from a good distance. It is easily achievable on vehicle paintwork because the industry is set up for it and the volumes consumed are high, keeping costs low.
However, I have learned to have low expectations for a paint match on a bike. All I want is for the white undercoat revealed by the paint chip or deep scratch to look less obvious. How hard can that be? Very hard in fact, my best effort on my pale green Kona Dawg were almost not worth bothering with. I consoled myself that at least I'd put something on and had stabilised the chip from peeling further. I would have been better just using a DMR sticker to cover the chip/scratches. Seriously, I mean that.
If the local auto parts shop (in the UK it's Halfords) can't produce anything, get yourself off to a hobby shop where they sell enamel paint in very small tins about one inch high. I remember buying all the closest shades of green and mixing and matching The result still looked like it was shouting "look at me, incompetent paint job!" Yes, I really would have been better off with a DMR sticker!
For black, the finish is also a factor. Do you have smooth gloss, metallic , pearlescent, satin, semi-satin, half matt, matt..........Even if you get the correct shade the wrong finish will make the repair shriek at you. So consider felt tip pens, magic markers, thinned down household paint - whatever you can think of. But probably best to just use a DMR sticker! (Or other bike component brand of your choice!)