I have a friend who painted a carpet black. It too was faded from years of sun. I think he used an S.E.M. product for dyeing carpet and other material. It looks good but I can not attest to the life span of it yet.
Correct and quality molded carpets have gotten very expensive; worth the effort it the carpets are in good condition. Nothing to lose.
I purchased a replacement carpet about 20 years ago. They were stored inside, never installed and they still faded.