I recently had to replace a rear wheel but couldn't get an all black one to match the front so spayed the rim (disc) and spokes with a rattle can, hub was already black. It looks okay but if you're fussy it may not be acceptable.
The hardest part is making sure you've covered all the spokes.