Melanin
Melanin is a class of compounds found in the plant, animal and protista kingdoms, where it serves predominantly as a pigment.  The most common form of biological melanin is eumelanin, a brown-black polymer of dihydroxyindole (also known as hydroquinone), dihydroxyindole carboxylic acid, and their reduced forms.  Another common form of melanin is pheomelanin, a red-brown polymer of benzothiazine units largely responsible for red hair and freckles.  The presence of melanin in the archaea and bacteria kingdoms is an issue of ongoing debate amongst researchers in the field. 
The increased production of melanin in human skin is called melanogenesis. It is stimulated by the DNA damages that are caused by UVB-radiation, and it leads to a delayed development of a tan. This melanogenesis-based tan takes more time to develop, but it is long lasting.
The photochemical properties of melanin make it an excellent photoprotectant. It absorbs harmful UV-radiation and transforms the energy into harmless amounts of heat through a process called "ultrafast internal conversion". This property enables melanin to dissipate more than 99.9% of the absorbed UV radiation as heat and it keeps the generation of free radicals at a minimum (see photoprotection). This prevents the indirect DNA damage which is responsible for the formation of malignant melanoma.

# Melanin in humans
In humans, melanin is the primary determinant of human skin color and also found in hair, the pigmented tissue underlying the iris, the medulla  and zona reticularis of the adrenal gland, the stria vascularis of the inner ear, and in pigment-bearing neurons within areas of the brainstem, such as the locus ceruleus and the substantia nigra.
Dermal melanin is produced by melanocytes, which are found in the stratum basale of the epidermis. Although human beings generally possess a similar concentration of melanocytes in their skin, the melanocytes in some individuals and ethnic groups more frequently or less frequently express the melanin-producing genes, thereby conferring a greater or lesser concentration of skin melanin. Some individual animals and humans have very little or no melanin in their bodies, a condition known as albinism.
Because melanin is an aggregate of smaller component molecules, there are a number of different types of melanin with differing proportions and bonding patterns of these component molecules.  Both pheomelanin and eumelanin are found in human skin and hair, but eumelanin is the most abundant melanin in humans, as well as the form most likely to be deficient in albinism.
Eumelanin polymers have long been thought to comprise numerous cross-linked 5,6-dihydroxyindole (DHI) and 5,6-dihydroxyindole-2-carboxylic acid (DHICA) polymers; recent research into the electrical properties of eumelanin, however, has indicated that it may consist of more basic oligomers adhering to one another by some other mechanism. Thus, the precise nature of eumelanin's molecular structure is once again the object of study.   Eumelanin is found in hair and skin, and colors hair grey, black, yellow, and brown.  In humans, it is more abundant in peoples with dark skin.
There are two different types of eumelanin, which are distinguished from each other by their
pattern of polymer bonds. The two types are black eumelanin and brown eumelanin, with black melanin being darker than brown. Black eumelanin is in mostly non-Europeans and aged Europeans, while brown eumelanin is in mostly young Europeans.
A small amount of black eumelanin in the absence of other pigments causes grey hair.
A small amount of brown eumelanin in the absence of other pigments causes yellow (blond) color hair.
Pheomelanin is also found in hair and skin and is both in lighter skinned humans and darker skinned humans. In general women have more pheomelanin than men, and thus women's skin is generally redder than men's.  Pheomelanin imparts a pink to red hue and, thus, is found in particularly large quantities in red hair. Pheomelanin is particularly concentrated in the lips, nipples, glans of the penis, and vagina.  Pheomelanin also may become carcinogenic when exposed to the ultraviolet rays of the sun. Chemically, pheomelanin differs from eumelanin in that its oligomer structure incorporates benzothiazine units which are produced instead of DHI and DHICA when the amino acid L-cysteine is present.
Neuromelanin is the dark pigment present in pigment bearing neurons of four deep brain nuclei: the substantia nigra (in Latin, literally "black substance") - Pars Compacta part, the locus ceruleus ("blue spot"), the dorsal motor nucleus of the vagus nerve (cranial nerve X), and the median raphe nucleus of the pons.  Both the substantia nigra and locus ceruleus can be easily identified grossly at the time of autopsy due to their dark pigmentation.  In humans, these nuclei are not pigmented at the time of birth, but develop pigmentation during maturation to adulthood.  Although the functional nature of neuromelanin is unknown in the brain, it may be a byproduct of the synthesis of monoamine neurotransmitters for which the pigmented neurons are the only source.   The loss of pigmented neurons from specific nuclei is seen in a variety of neurodegenerative diseases.  In Parkinson's disease there is massive loss of dopamine producing pigmented neurons in the substantia nigra.  A common finding in advanced Alzheimer's disease is almost complete loss of the norepinephrine producing pigmented neurons of the locus ceruleus.  Neuromelanin has been detected in primates and in carnivores such as cats and dogs.

# Melanin in other organisms
Melanins have very diverse roles and functions in various organisms. A form of eumelanin makes up the ink used by Cuttlefish as a defence mechanism against predators. Melanins also protect microorganisms, such as bacteria and fungi, against stresses that involve cell damage by solar UV radiation or generation of reactive oxygen species. These include high temperature as well as chemical (e.g. heavy metals and oxidizing agents), and biochemical (e.g., host defenses against invading microbes) stresses. Therefore, in many pathogenic microbes (for example, in Cryptococcus neoformans, a fungus) melanins appear to play important roles in virulence and pathogenicity by protecting the microbe against immune responses of its host. A potentially novel role of melanin as a photosynthetic pigment in some fungi, enabling them to capture gamma rays and harness its energy for growth has recently been described. (See radiotrophic fungus) In invertebrates, a major aspect of the innate immune defense system against invading pathogens involves melanin. Within minutes after infection, the microbe is encapsulated within melanin (melanization), and the generation of free radical byproducts during the formation of this capsule is thought to aid in their killing.

# Biosynthetic pathways
The first step of the biosynthetic pathway for both eumelanins and pheomelanins is catalysed by tyrosinase:
Dopaquinone can combine with cysteine by two pathways to benzothiazines and pheomelanins
Alternatively, dopaquinone can be converted to leucodopachrome and follow two more pathways to the eumelanins
Microscopic appearance
Under the microscope melanin is brown, non-refractile and finely granular with individual granules having a diameter of less than 800 nanometers.  This differentiates melanin from common blood breakdown pigments which are larger, chunky and refractile and range in color from green to yellow or red-brown.  In heavily pigmented lesions, dense aggregates of melanin can obscure histologic detail.  A dilute solution of potassium permanganate is an effective melanin bleach.

# Melanin deficiency in genetic disorders and disease states
Melanin deficiency has been connected for some time with various genetic abnormalities and disease states.
There are approximately ten different types of oculocutaneous albinism, which is mostly an autosomal recessive disorder.  Certain ethnicities have higher incidences of different forms.  For example, the most common type, called oculocutaneous albinism type 2 (OCA2), is especially frequent among people of black African descent.  It is an autosomal recessive disorder characterized by a congenital reduction or absence of melanin pigment in the skin, hair and eyes.  The estimated frequency of OCA2 among African-Americans is 1 in 10,000, which contrasts with a frequency of 1 in 36,000 in white Americans. In some African nations, the frequency of the disorder is even higher, ranging from 1 in 2,000 to 1 in 5,000. Another form of Albinism, the "yellow oculocutaneous albinism", appears to be more prevalent among the Amish, who are of primarily Swiss and German ancestry. People with this IB variant of the disorder commonly have white hair and skin at birth, but rapidly develop normal skin pigmentation in infancy.
Ocular albinism affects not only eye pigmentation, but visual acuity, as well.  People with albinism typically test poorly, within the 20/60 to 20/400 range.  Additionally, two forms of albinism, with approximately 1 in 2700 most prevalent among people of Puerto Rican origin, are associated with mortality beyond melanoma-related deaths.
Mortality also is increased in patients with Hermansky-Pudlak syndrome and Chediak-Higashi syndrome. Patients with Hermansky-Pudlak syndrome have a bleeding diathesis secondary to platelet dysfunction and also experience restrictive lung disease (pulmonary fibrosis), inflammatory bowel disease, cardiomyopathy, and renal disease. Patients with Chediak-Higashi syndrome are susceptible to infection and also can develop lymphofollicular malignancy.
The role that melanin deficiency plays in such disorders remains under study.
The connection between albinism and deafness has been well known, though poorly understood, for more than a century-and-a-half. In his 1859 treatise On the Origin of Species, Charles Darwin observed that "cats which are entirely white and have blue eyes are generally deaf". In humans, hypopigmentation and deafness occur together in the rare Waardenburg's syndrome, predominantly observed among the Hopi in North America.  The incidence of albinism in Hopi Indians has been estimated as approximately 1 in 200 individuals. Interestingly, similar patterns of albinism and deafness have been found in other mammals, including dogs and rodents. However, a lack of melanin per se does not appear to be directly responsible for deafness associated with hypopigmentation, as most individuals lacking the enzymes required to synthesize melanin have normal auditory function. Instead the absence of melanocytes in the stria vascularis of the inner ear results in cochlear impairment, though why this is is not fully understood. It may be that melanin, the best sound absorbing material known, plays some protective function. Alternately, melanin may affect development, as Darwin suggests.
In Parkinson's disease, a disorder that affects neuromotor functioning,  there is decreased neuromelanin in the substantia nigra as consequence of specific dropping out of dopaminergic pigmented neurons.  This results in diminished dopamine synthesis.  While no correlation between race and the level of neuromelanin in the substantia nigra has been reported, the significantly lower incidence of Parkinson's in blacks than in whites has "prompt some to suggest that cutaneous melanin might somehow serve to protect the neuromelanin in substantia nigra from external toxins.". Also see Nicolaus review article on the function of neuromalanins
In addition to melanin deficiency, the molecular weight of the melanin polymer may be decreased due to various factors such as oxidative stress, exposure to light, perturbation in its association with melanosomal matrix proteins, changes in pH or in local concentrations of metal ions. A decreased molecular weight or a decrease in the degree of polymerization of ocular melanin has been proposed to turn the normally anti-oxidant polymer into a pro-oxidant. In its pro-oxidant state, melanin has been suggested to be involved in the causation and progression of macular degeneration and melanoma. (Ref: Pigment cell Res. 2001; volume 14: pages 148-154. "Redox regulation in human melanocytes and melanoma")
Higher eumelanin levels also can be a disadvantage, however, beyond a higher disposition toward vitamin D deficiency. Dark skin is a complicating factor in the laser removal of port-wine stains.  Effective in treating white skin, lasers generally are less successful in removing port-wine stains in people of Asian or African descent.  Higher concentrations of melanin in darker-skinned individuals simply diffuse and absorb the laser radiation, inhibiting light absorption by the targeted tissue.  Melanin similarly can complicate laser treatment of other dermatological conditions in people with darker skin.
Freckles and moles are formed where there is a localized concentration of melanin in the skin. They are highly associated with pale skin.

## Melanin and human adaptation
Melanocytes insert granules of melanin into specialized cellular vesicles called melanosomes. These are then transferred into the other skin cells of the human epidermis. The melanosomes in each recipient cell accumulate atop the cell nucleus, where they protect the nuclear DNA from mutations caused by the ionizing radiation of the sun's ultraviolet rays. People whose ancestors lived for long periods in the regions of the globe near the equator generally have larger quantities of eumelanin in their skins. This makes their skins brown or black and protects them against high levels of exposure to the sun, which more frequently results in melanomas in lighter skinned people.
With humans, exposure to sunlight stimulates the skin to produce vitamin D.  Because high levels of cutaneous melanin act as a natural sun screen, dark skin can be a risk factor for vitamin D deficiency.
In the United Kingdom, which lies at a northern latitude, descendants of the Britons have white skin. When their skin is exposed to the meager sunlight, the scant amount of melanin their skin produces is unable to block the sunlight. Therefore, their bodies are able to make Vitamin D with the help of sunlight. Vitamin D, a vitamin found in fish oil, is necessary to prevent rickets, a bone disease caused by too little calcium.
In contrast, in Sub-Saharan Africa, which is near the equator, humans with a higher concentration of melanin absorb more intense sunlight to make Vitamin D.  Africans visiting the United Kingdom during the Industrial Revolution developed symptoms of rickets, such as retarded growth, bowed legs, and fractures because sunlight at that latitude was insufficient for their melanin levels.
Fortunately, in 1930, Vitamin D was discovered and dispensed as a supplement to add to the diet. Now many common foods like milk and bread are Vitamin D fortified.
The most recent scientific evidence indicates that all humans evolved in Africa, then populated the rest of the world through successive radiations.  It is most likely that the first people had relatively large numbers of eumelanin producing melanocytes and, accordingly, darker skin (as displayed by the indigenous people of Africa, today). As some of these original peoples migrated and settled in areas of Asia and Europe, the selective pressure for eumelanin production decreased in climates where radiation from the sun was less intense. Thus variations in genes involved in melanin production began to appear in the population, resulting in lighter hair and skin in humans residing at northern latitudes. Studies have been carried out to determine whether these changes were due to genetic drift or positive selection, perhaps driven by requirement for vitamin D. Of the two common gene variants known to be associated with pale human skin, Mc1r does not appear to have undergone positive selection, while SLC24A5 has.
As with peoples who migrated northward, those with light skin who migrate southward acclimatize to the much stronger solar radiation. Most people's skin darkens when exposed to UV light, giving them more protection when it is needed. This is the physiological purpose of sun tanning. Dark-skinned people, who produce more skin-protecting eumelanin, have a greater protection against sunburn and the development of melanoma, a potentially deadly form of skin cancer, as well as other health problems related to exposure to strong solar radiation, including the photodegradation of certain vitamins such as riboflavins, carotenoids, tocopherol, and folate.
Melanin in the eyes helps protect them from ultraviolet and high-frequency visible light; people with blue eyes are more at risk for sun-related eye problems. Further, the ocular lens yellows with age, providing added protection. However, the lens also becomes more rigid with age, losing most of its accommodation  the ability to change shape to focus from far to near  a detriment due probably to protein crosslinking caused by UV exposure.
Recent research by J.D. Simon et al. (Pigment Cell Research, 2004, 17: 262-269) suggests that melanin may serve a protective role other than photoprotection.  Melanin is able to effectively ligate metal ions through its carboxylate and phenolic hydroxyl groups, in many cases much more efficiently than the powerful chelating ligand ethylenediaminetetraacetate (EDTA).  It may thus serve to sequester potentially toxic metal ions, protecting the rest of the cell.  This hypothesis is supported by the fact that the loss of neuromelanin observed in Parkinson's disease is accompanied by an increase in iron levels in the brain.

# Physical properties and technological applications
Melanins are "rigid-backbone" conductive polymers composed of polyacetylene, polypyrrole, and polyaniline "Blacks" and their mixed copolymers.   The simplist melanin is polyacetylene,  from which all others derive.  Some fungal melanins are pure polyacetylene.
In 1963, DE Weiss and coworkers reported  high electrical conductivity in a melanin, iodine-doped and oxidized polypyrrole "Black".  They achieved the quite high conductivity of 1 Ohm/cm.   A decade later, John McGinness, and coworkers reported a high conductivity "ON" state in a voltage-controlled solid-state threshold switch made with DOPA melanin .  Further,  this material emitted a flash of lightelectroluminescencewhen it switched.  Melanin also shows negative resistance,  a classic property of electronically-active conductive polymers.  Likewise,  melanin is the best sound-absorbing material known due to strong electron-phonon coupling.   This may be related to melanin's presence in the inner ear.
These early discoveries were "lost" until the recent emergence of such melanins in device applications, particularly electroluminescent displays. In 2000, the Nobel Prize in Chemistry was awarded to three scientists for their subsequent 1977 (re)discovery and development of such conductive organic polymers.    In an essential reprise of Weiss et al's work,  these polymers were oxidized, iodine-doped "polyacetylene black" melanins.  There is no evidence the Nobel committee was aware of Weiss et als  almost identical prior report of passive high conductivity in iodinated polypyrrole black or of switching and high electrical conductivity in DOPA melanin and related organic semiconductors. The melanin organic electronic device is now in the Smithsonian Institution's National Museum of American History's "Smithsonian Chips" collection of historic solid-state electronic devices.
Melanin influences neural activity and mediates the conduction of radiation, light, heat and kinetic energy.  As such, it is the subject of intense interest in biotech research and development, most notably in organic electronics (sometimes called "plastic electronics") and nanotechnology, where dopants are used to dramatically boost melanin conductivity.  Pyrrole black and acetylene black are the most commonly studied organic semiconductors.
Although synthetic melanin (commonly referred to as BSM, or "black synthetic matter") is made up of 3-6 oligomeric units linked togetherthe so-called "protomolecule"there is no evidence that naturally occurring biopolymer (BCM, for "black cell matter") mimics this structure.  However, since there is no reason to believe that natural melanin does not belong to the category of the polyarenes and polycationic polyenes, like pyrrol black and acetylene black, it is necessary to review all the chemical and biological analytic data gathered to date in the study of natural melanins (eumelanins, pheomelanins, allomelanins)." 
Evidence exists in support of a highly cross-linked heteropolymer bound covalently to matrix scaffolding melanoproteins (Eur. J. Biochem. 1995; 232: 159-164 "Interaction of melanosomal proteins with melanin). It has been proposed that the ability of melanin to act as an antioxidant is directly proportional to its degree of polymerization or molecular weight (Ophthalmic research, 2005, 37: 136-141 "Melanin aggregation and polymerization: possible implications in age related macular degeneration"). Suboptimal conditions for the effective polymerization of melanin monomers may lead to formation of lower-molecular-weight, pro-oxidant melanin that is has been implicated in the causation and progression of macular degeneration and melanoma. (Clinical Cancer Res. 2004; 10: 2581-2583 "Etiologic pathogenesis of melanoma: a unifying hypothesis for the missing attributable risk"). Signaling pathways that upregulate melanization in the retinal pigment epithelium (RPE) also may be implicated in the downregulation of rod outer segment phagocytosis by the RPE. This phenomenon has been attributed in part to foveal sparing in macular degeneration. (Mol. Vis. 2005; 11: 482-490 "Melanization and phagocytosis: implications for age-related macular degeneration).

# Melanin-based bias in human societies
When skin pigmentation as a characteristic of race is linked to social status or other human attributes, this phenomenon is known as  racialism. Many people and societies overlay racialism with racist perceptions and systems which arbitrarily assign to groups of people a status of inherent superiority or inferiority, privilege or disadvantage based on skin color or racial classification. Apartheid-era South Africa is an example of a white supremacist society based on a system of stratification of power and privilege by skin color, as well as racial admixture. Similar examples can be found in India's caste system; Brazil's highly socially color-stratified society; and, in the U.S., segregation and institutional racism on the part of white-controlled institutions, and internal "color consciousness" on the part of members of some ethnic minorities. Because of the pervasive influence of white supremacist values worldwide, prejudice against people with more highly pigmented skin is the most pervasive form of color bias. Conversely, black supremacy is a far less pervasive phenomenon. Many other societies remain informally divided on the basis of skin color and, often, related ethnicity. (See also colonialism, Nazism and institutional racism.)
Illogical presumptions about people with regard to hair color are far less common than skin-color bias, have far fewer and less serious real-world implications, and are more often applied to women than to men. Common stereotypes in the West are dumb blondes, hot-tempered redheads and vixen brunettes.