Ok I thought I'd start doing some digging on this subject. I've only just started so, I can't say I have any definitive answers; however I DO believe we can narrow / specify things a bit.
With plants there are only a few sets of pigments (biochromes) that are even possible. So, first; the coloration we see must be one of these pigments.
The pigments in plants are: Chlorophyll, Carotenoids, Anthocyanins and Betalains. You can find this info here:
reference
We can look at these and further reduce this down. Chlorophyll is responsible for green and we are all aware of it. Carotenoids are responsible for red, orange or yellow colorations and would be most common in carrots. Anthocyanins cover the largest category of colors including red, blue, purple, yellow-green and even colorless. Betalains are red or yellow also but cannot occur in situations where Anthocyanins do. Now, Anthyocyanins are somewhat unique in that they do occur in virually all live parts; including roots, stems, leaves, flowers; etc.
From this; we can easily presume that the pigment responsible for colors in cannabis (this would be inclusive of reds, purples or blacks in stems, leaves and flowers) is Anthocyanins. You can find some basic info on this pigment here;
reference.
Some things of particular note here are that
"Anthocyanins can be used as pH indicators because their color changes with pH; they are pink in acidic solutions (pH < 7), purple in neutral solutions (pH ~ 7), greenish-yellow in alkaline solutions (pH > 7), and colourless in very alkaline solutions, where the pigment is completely reduced".. Also, that
"Anthocyanins are found in the cell vacuole, mostly in flowers and fruits but also in leaves, stems, and roots. In these parts, they are found predominantly in outer cell layers such as the epidermis and peripheral mesophyll cells"
Also, I suppose the explanation for autumn leaves and strains that tend to "naturally" turn purple towards harvest; may also be of similar origin or nature.
"The reds, the purples, and their blended combinations that decorate autumn foliage come from anthocyanins. Unlike the carotenoids, these pigments are not present in the leaf throughout the growing season, but are actively produced towards the end of summer.[27] They develop in late summer in the sap of the cells of the leaf, and this development is the result of complex interactions of many influences, both inside and outside the plant. Their formation depends on the breakdown of sugars in the presence of bright light as the level of phosphate in the leaf is reduced."
There are a few other resources that I'm currently looking through; but it seems we can explain many of these color expressions.
reference
"Plants also show tremendous diversity in anthocyanin expression. In leaves, for example, anthocyanins may colour the entire blade, or else be restriced to the margins, stripes, patches, or seemingly random spots on the upper, lower or both lamina surfaces. In some leaves, only the petiole and major veins are pigmented red, in others it is the interveinal lamina tissue, or the stipules, or domatia that are anthocyanic. .........."In many species, anthocyanins are produced only when the plant is unhealthy or has been exposed to environmental stress, but there are some that develop the red pigments even under optimal growth environments."
"Irrespective of their cellular location, however, anthocyanin biosynthesis in many leaves is generally upregulated in response to one or more environmental stressors. These include: strong light, UV-B radiation, temperature extremes, drought, ozone, nitrogen and phosphorus deficiencies, bacterial and fungal infections, wounding, herbivory, herbicides and various pollutants. Because of their association with such biotic and abiotic stressors, anthocyanins are usually considered to be a stress symptom and / or part of a mechanism to mitigate the effects of stress."
If we look at merely this section here; it would cover all the possible aspects about purple striped stems that have been proposed (xD), even though fairly open and no reasoning. Though, it is possible to have a anthocyanic response from temp, season, N-, P-, Light, etc etc; including that it can be a normal expression. In fact, since many ornamental flowers do this "normally" there has been much investigation into this; so that's good from a certain perspective.
My intent now, I suppose, is to try and see if there's much research as to what is going on inside the plant to cause these changes. Possibly we can get to some evidence and maybe even tests with "candy stripes" specifically. My first thoughts are (since the color of pigment is altered by pH) that something is causing an internal change to the pH where these pigments are located that is leading to the stripes we see. I'm guessing that there's some by-product created from moving various organic / inorganic compounds internally that possibly get deposited or accumulated which causes the pH change. I'm not sure if I'll easily find the answer as I cannot think of another type of plant species that does show this particular characteristic.
This book:
resource From what I was able to read; covered the various ways that coloration of anthocyanins can occur. A couple notes of interest from this;
"Anthocyanins are stored in an organized aqueous medium in the cell vacuoles. A slightly acidic environment (pH 3-5) rich in inorganic ions and other polyphenols is essential for the transformations in these pigments that enable the formation of molecular complexes and subsequent color changes and stabilization."
another quote I will shorten to make it a tiny bit more digestable;
"The structure depicted in Fig. 1.2 depicts the positively charged flavylium cation, which is the dominant equilibrium form in strongly acidic solutions. The positive charge is delocalized throughout....although carbons 2 and 4 are the more positively charged atoms. The relative ease of deprotonation of the two OH at positions 4 and 7 contributes to the color changes of anthocyanin. One of these OH loses a proton at pH~4 producing bases that exhibit a chromatic deviation toward longer wavelengths. At pH close to neutrality, a second deprotonation occurs leading to the formation of the anionic bases, with another blue shift in the absorption spectrum."
Possibly has one avenue of interest for our situation here; Metalloanthocyanins.
"All anthocyanins possesing a catechol structure in their B-ring, that is, all derivatives of cyanidin, delphinidin, and petunidin, are known to have the capacity of complex formation with several small divalent and trivalent metal cations. This type of association has been demonstrated to be at the origin of the blue color in some flowers. Metals most commonly found in the formation of such metalloanthocyanins are Iron (III), Magnesium (II) and Aluminum (III)."
anyway. At least so far we can say what it is that's being expressed. I'm not sure if there will be a way to nail things down further, but I'll keep digging some. If I find any more goodies; I can post them if anyone wants.
hope this helps