Dichromatism (or polychromatism) is a phenomenon where a material or solution's hue is dependent on both the concentration of the absorbing substance and the depth or thickness of the medium traversed.  In most substances which are not dichromatic, only the brightness and saturation of the colour depend on their concentration and layer thickness.
Examples of dichromatic substances are pumpkin seed oil, bromophenol blue, and resazurin. When the layer of pumpkin seed oil is less than 0.7 mm thick, the oil appears bright green, and in layer thicker than this, it appears bright red.
The phenomenon is related to both the physical chemistry properties of the substance and the physiological response of the human visual system to colour. This combined physicochemical–physiological basis was first explained in 2007. 
In gemstones, dichromatism is sometimes referred to as the 'Usambara effect'. 
Dichromatic properties can be explained by the Beer–Lambert law and by the excitation characteristics of the three types of cone photoreceptors in the human retina. Dichromatism is potentially observable in any substance that has an absorption spectrum with one wide but shallow local minimum and one narrow but deep local minimum. The apparent width of the deep minimum may also be limited by the end of the visible range of human eye; in this case, the true full width may not necessarily be narrow. As the thickness of the substance increases, the perceived hue changes from that defined by the position of the wide-but-shallow minimum (in thin layers) to the hue of the deep-but-narrow minimum (in thick layers).
The absorbance spectrum of pumpkin seed oil has the wide-but-shallow minimum in the green region of the spectrum and deep local minimum in the red region. In thin layers, the absorption at any specific green wavelength is not as low as it is for the red minimum, but a broader band of greenish wavelengths are transmitted, and hence the overall appearance is green. The effect is enhanced by the greater sensitivity to green of the photoreceptors in the human eye, and the narrowing of the red transmittance band by the long-wavelength limit of cone photoreceptor sensitivity. According to the Beer–Lambert law, when viewing through the coloured substance (and thus ignoring reflection), the proportion of light transmitted at a given wavelength, T, decreases exponentially with thickness t, T = e−at, where a is the absorbance at that wavelength. Let G = e−aGt be the green transmittance and R = e−aRt be the red transmittance. The ratio of the two transmitted intensities is then (G/R) = e(aR-aG)t. If the red absorbance is less than the green, then as the thickness t increases, so does the ratio of red to green transmitted light, which causes the apparent hue of the colour to switch from green to red.
The extent of dichromatism of material can be quantified by the Kreft's dichromaticity index (DI). It is defined as the difference in hue angle (Δhab) between the colour of the sample at the dilution, where the chroma (colour saturation) is maximal and the colour of four times more diluted (or thinner) and four times more concentrated (or thicker) sample. The two hue angle differences are called dichromaticity index towards lighter (Kreft's DIL) and dichromaticity index towards darker (Kreft's DID) respectively.  Kreft's dichromaticity index DIL and DID for pumpkin oil, which is one of the most dichromatic substances, are −9 and −44, respectively. This means that pumpkin oil changes its colour from green-yellow to orange-red (for 44 degrees in Lab colour space) when the thickness of the observed layer is increased from cca 0.5 mm to 2 mm; and it changes slightly towards green (for 9 degrees) if its thickness is reduced for 4-fold.
A record by William Herschel (1738–1822), shows he observed dichromatism with a solution of ferrous sulphate and tincture of nutgall in 1801 when working on an early solar telescope, but he did not recognise the effect.