Ttle color based on category wordpress

I need to set post title bg-color based on category color. I have custom made WordPress template (nes blog) and I have colored category tags (sport- green, politivs – red,…). Now I need to set up bg-color of titles based on that category bg-color. For exapmple sport title background green…