Purple is just a change in the pigment. It can be a genetic trait that certain plants express. It can also be brought on by colder temperatures, though many are under the belief that all cannabis plants will turn purple from the cold, and thats not the case. If the plant doesn't carry the specific trait of purpling pigment, then it won't turn purple.
Plant stress, deficiencies, genetics, and cold can all play a role in purple expression. It's not anything to be concerned about if you are near harvest.