Graph color conjuction mathematica

In the image, I split the graph of h[x] into 4 different graphs that show h[x] in different intervals with different colors. Is there anyway to show the entire function in one graph but have the sections be color coded like in the split versions?Each section of the graph would have a distinct colorenter image description here