On AMOLED displays, that #000000 not only looks nice, it also saves battery, as it shuts the given pixel off. The difference is substantial - with modern UI trends that waste most of screen space, a "grey on pure black" color scheme can often keep more than 50% of the pixels off! Meanwhile, a typical "grey on grey" dark mode will keep 100% of them on.
The power consumption on pure black vs another dark color is extremely similar. This is because on AMOLED screens individual pixels control themselves and power for off vs dark is very similar.
Source: https://www.xda-developers.com/amoled-black-vs-gray-dark-mod...
Also, gray uniformity is an unfortunate shortcoming on a lot of OLEDs.
Straight hex codes of course work, but they're not a good option if the program has more than one color.