Hi Nidhi!
You can use color coding for any definition you'd like. So, if you'd like to have it mean story status, just pick what color you'd like for each state and start coloring. Usually, though, people use the color for more static information, like the initiative for a story or the stakeholder who requested it. You may be better off opting to show the story's status as a field or column in the different views where you want to prominently show it. You can usually do this with the button of a '+' and hamburger:
You could also follow the same approach as my answer to How to mark user story as complete automatically once the remaining effort is marked as zero ? and write a code solution to update the color automatically.
Just let me know if more info would help, and if you want to give more details about why you want to color code by state then I may be able to help more in thinking of other solutions for the problem you're trying to solve.
-William