Just get some cheap spray cans and paint it black, beleive me it works great I've done it, changed my blue carpet to black in about 15 mins and 3 cans of paint, cheap weekender spray from walmart, a light coat is all you need it dries fast and so far hasn't worn off at all, go ahead and laugh but you would never know the carpet was blue, although this was in a car not a boat.
The only thing I would worry about would be off colors from UV damage. You could always use 'Rit' fabric dye, but like drewpster said.... it would be better to just replace it even if you just use indoor / outdoor carpet from Lowe's. If you look around you can find decently priced re-carpeting kits for boats. I did mine for $150, and it took me about 10 hours total from start to finish, but I'm a slow worker. New carpet adds a 'new feel' to your boat, and you would really enjoy it.
a70 i'm not laughing, i've done the same thing to dirty carpet in some of my restores. oil spills cover right up, and it last. cheap walmart 1.00 per can. it's better than dye coming off on your bare feet.