Navagraha

Nine planets, nine colours

A colour scheme for terminal and editor whose tones were not picked but read off: every colour is the classical colour of a graha, its saturation follows that planet's strength in one particular birth chart as far as the hue allows.

dignity.ts
// dignity.ts
import { Graha } from "./jyotisha"

export function dignity(g: Graha): string {
  const arc = Math.abs(g.longitude - g.exaltation)
  if (arc < 3) return "uccha"
  if (g.retrograde) return "vakri"
  return "sama"
}

// Mond: 46,38° siderisch, exaltiert in Rohini
dignity(chandra)  // "uccha"

The same file in the selected variant.

From chart to code

Every colour in the editor has a place in the chart. Pick a graha: on the left is where it stands in the horoscope, on the right what its colour paints in code.

7 1 8 2 9 3 10 4 11 5 12 6 1 7 2 8 3 9 4 10 5 11 6 12 Gu Ke Śu Ch Bu Ra Ma Śa
The numbers name the zodiac signs. In a North Indian chart the houses are fixed: the first is top centre, the rest run anticlockwise from there.

The nine grahas with sign and house

  • Sun (Sūrya): Taurus, 8th house
  • Moon (Chandra): Taurus, 8th house
  • Mars (Mangala): Virgo, 12th house
  • Mercury (Budha): Taurus, 8th house
  • Jupiter (Guru): Libra, 1st house
  • Venus (Shukra): Pisces, 6th house
  • Saturn (Shani): Virgo, 12th house
  • ascending lunar node (Rahu): Gemini, 9th house
  • descending lunar node (Ketu): Sagittarius, 3rd house

23 May 1982, 19:47 CEST, Wedel. Sidereal, Lahiri ayanamsa, whole-sign houses. Lagna in Tula.

Sun Sūrya

Placement in the chart
Taurus, 8th house
Role in code
Numbers and constants
copper red

Moon Chandra

Placement in the chart
Taurus, 8th houseexalted
Role in code
Identifiers and body text
white

Mars Mangala

Placement in the chart
Virgo, 12th house
Role in code
Keywords and control flow
blood red

Mercury Budha

Placement in the chart
Taurus, 8th houseretrograde
Role in code
Strings
grass green

Jupiter Guru

Placement in the chart
Libra, 1st housedig bala
Role in code
Functions and selectors
golden yellow

Venus Shukra

Placement in the chart
Pisces, 6th houseexalted, atmakaraka
Role in code
Types and property names
iridescent white

Saturn Shani

Placement in the chart
Virgo, 12th houseretrograde
Role in code
Operators
dark blue

ascending lunar node Rahu

Placement in the chart
Gemini, 9th house
Role in code
Preprocessor, at-rules, tags
smoky

Rahu paints preprocessor directives, at-rules and tags. Neither line here contains any.

descending lunar node Ketu

Placement in the chart
Sagittarius, 3rd house
Role in code
Comments
ash grey
const arc = Math.abs(g.longitude - g.exaltation)
if (arc < 3) return "uccha"  // exaltiert

Two lines from the file below, coloured word by word according to graha.

How the scheme is built

First: what a graha is

Indian astrology works with nine celestial bodies — Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, and the two points where the Moon's path crosses the Sun's. These nine are the grahas. A birth chart records where they stood at one particular moment: in which zodiac sign, and in which of the twelve houses, each covering an area of life.

The two readings sit side by side and say different things: the sign says how a planet acts, the house says on what. That is why Guru sits at the top of the chart in Libra, the seventh sign, and in the first house at the same time. The switch under the chart says which of the two countings the numbers are showing.

Where the nine hues come from

Classical texts give every graha a fixed colour: the Sun copper red, the Moon white, Mars blood red, Mercury grass green, Jupiter golden yellow, Venus iridescent white, Saturn dark blue, and the two lunar nodes smoky and ash grey. These assignments are centuries old and appear in every standard source. That was this project's stroke of luck: nine planets give nine tones, they spread almost evenly around the wheel, and there are exactly as many as an editor needs for syntax. No tone had to be invented.

Polar chart of the nine hues: angle is hue, distance from the centre is saturation. Ch Ma Bu Gu Śu Śa Ra Ke Ch Ma Bu Gu Śu Śa Ra Ke Ch Ma Bu Gu Śu Śa Ra Ke Ch Ma Bu Gu Śu Śa Ra Ke

Angle is the hue, distance from the centre the saturation. Seven tones share the circle; Chandra and Ketu sit near the middle because white and ash grey carry no hue. The values are those of the selected variant.

Where each colour's force comes from

A graha can stand strong or weak in a chart — depending on the sign and the house it occupies. That strength decides the saturation here, but only within what the prescribed hue allows. Five cases from this chart, three of them evidence and two objections:

  • Venus stands in its most favourable sign, Pisces. That is called exalted, and it is the strongest placement there is. It is also atmakaraka, the planet at the highest degree, which the tradition reads as the most important of the chart. Its turquoise therefore sits at the limit: no more saturated is possible at that lightness.
  • Jupiter stands in the first house. For Jupiter that is the best position imaginable, called dig bala, literally directional strength. Its gold sits at the limit too. In the two light variants Sūrya reaches it as well — less headroom is left there, and three colours hit the ceiling at once.
  • Rahu is not a body but a crossing point, and counts as smoky and diffuse. It stays pale, under thirty per cent in every variant.
  • Saturn and Mars both stand in the twelfth house, the house of withdrawal and of what is hidden. Both should therefore be held back. Saturn does sit below Mars in every variant — but Mars stays in the upper middle at seventy to seventy-four per cent. For Mars the rule does not hold, and the ladder shows it rather than passing over it.
  • The Moon is where the rule ends. It stands exalted and should therefore be forceful. But its classical colour is white, and white carries no saturation. The hue comes first; strength cannot push past it.
Saturation of the nine grahas as a share of what is possible at their lightness.
Venus 100% exalted, atmakaraka
Jupiter 100% dig bala
Sun 79% 8th house
Mars 70% 12th house
Mercury 62% retrograde
Saturn 60% retrograde
Moon 32% exalted
ascending lunar node 28% 9th house
descending lunar node 7% 3rd house
Saturation of the nine grahas as a share of what is possible at their lightness.
Venus 100% exalted, atmakaraka
Jupiter 100% dig bala
Sun 79% 8th house
Mars 70% 12th house
Mercury 62% retrograde
Saturn 61% retrograde
ascending lunar node 28% 9th house
Moon 13% exalted
descending lunar node 11% 3rd house
Saturation of the nine grahas as a share of what is possible at their lightness.
Sun 100% 8th house
Jupiter 100% dig bala
Venus 100% exalted, atmakaraka
Mercury 84% retrograde
Mars 74% 12th house
Saturn 48% retrograde
Moon 33% exalted
ascending lunar node 29% 9th house
descending lunar node 13% 3rd house
Saturation of the nine grahas as a share of what is possible at their lightness.
Venus 100% exalted, atmakaraka
Sun 100% 8th house
Jupiter 100% dig bala
Mercury 84% retrograde
Mars 74% 12th house
Saturn 47% retrograde
ascending lunar node 29% 9th house
Moon 17% exalted
descending lunar node 7% 3rd house

Measured as a share of what is reachable at that lightness and hue — there is no other fair way to compare tones, since red can go more saturated than turquoise by nature. Shukra and Guru sit at the limit in every variant, joined by Sūrya in the light ones. At the bottom are the two lunar nodes — and Chandra, which stands exalted but is white.

Why there are two grounds

The background is the largest area on the screen. It should therefore come from whatever this chart clusters most clearly — and there were two ways to read that.

The first counts signs: five of the nine grahas stand in earth signs, in Taurus and Virgo. Earth gives a warm, brownish ground. Those are the Pratipada and Ushas variants.

The second takes the lagna, the ascendant: the sign rising on the eastern horizon at the moment of birth. The tradition holds it to be the sign of outward appearance. Here it is Libra, an air sign. Air gives a cool, clear ground — Swati and Tula.

The second path is in fact better founded: if any part of a chart decides visible form, it is the first house. Taurus and Virgo, by contrast, fall into the eighth and twelfth houses in this chart, the two most hidden ones — and they do so only because of this lagna. It is just that the warm ground simply looks good. So both stayed.

Earth — five grahas in Taurus and Virgo

Pratipada #16120d
Ushas #f8efe2

Air — the lagna in Libra

Swati #101317
Tula #ebf1f8

Four variants, two derivations. The three marks on each field are Shukra, Guru and Mangala on that ground.

Why the lightness values are not freely chosen

Finding colours that go together is one half of the work. The other is that the text still has to be readable afterwards. The web accessibility guidelines put a number on it: body text needs at least 4.5 times the lightness difference to its background. Many well-known schemes fall short of that in the comments, of all places.

Here every colour that can carry text is computed to exactly that value — and against all three background layers, not only the darkest. So the hue comes from the chart, the lightness from the arithmetic. Together they make the colour.

Contrast ranges of the nine colours against ground, surface and overlay.
Sun 4.57
Moon 9.98
Mars 4.60
Mercury 4.60
Jupiter 4.57
Venus 4.56
Saturn 4.58
ascending lunar node 4.57
descending lunar node 4.60
0 4.5 13

Each bar runs from the weakest case — against the overlay — to the strongest against the ground, showing the worst value across all four variants. The line sits at 4.5. Eight colours end just past it because they were computed to exactly that; only Chandra has headroom, since it carries the body text.

Show every value
Contrast against the three layers — Swati
Colour GroundSurfaceOverlay
Sun 5.885.344.61
Moon 12.7311.579.98
Mars 5.885.344.61
Mercury 5.875.334.60
Jupiter 5.855.324.59
Venus 5.815.284.56
Saturn 5.835.304.58
ascending lunar node 5.835.294.57
descending lunar node 5.865.334.60
Chandra, damped 7.236.585.67
Body text requires at least 4.50
Contrast against the three layers — Pratipada
Colour GroundSurfaceOverlay
Sun 5.895.364.57
Moon 12.9611.8010.07
Mars 5.925.394.60
Mercury 5.955.414.62
Jupiter 5.885.364.57
Venus 5.955.424.62
Saturn 5.915.394.59
ascending lunar node 5.965.424.63
descending lunar node 5.975.434.64
Chandra, damped 7.386.725.73
Body text requires at least 4.50
Contrast against the three layers — Ushas
Colour GroundSurfaceOverlay
Sun 5.735.274.71
Moon 12.8611.8310.58
Mars 5.695.244.68
Mercury 5.735.284.72
Jupiter 5.685.234.67
Venus 5.785.324.76
Saturn 5.775.314.75
ascending lunar node 5.715.264.70
descending lunar node 5.715.254.70
Chandra, damped 7.086.515.82
Body text requires at least 4.50
Contrast against the three layers — Tula
Colour GroundSurfaceOverlay
Sun 5.665.224.66
Moon 12.8611.8710.60
Mars 5.705.264.70
Mercury 5.745.304.73
Jupiter 5.695.254.69
Venus 5.645.214.65
Saturn 5.695.254.69
ascending lunar node 5.725.284.72
descending lunar node 5.745.304.73
Chandra, damped 6.966.425.74
Body text requires at least 4.50

The terms at a glance

Graha
One of the nine celestial bodies Indian astrology works with. Literally: the one that seizes.
Lagna
The ascendant. The zodiac sign rising on the eastern horizon at the moment of birth. Stands for outward appearance.
Sign
One of the twelve zodiac signs. Says in what manner a graha acts. The signs are fixed in the sky.
House
One of twelve sections of the chart, each for an area of life. Says what a graha acts upon. Counted from the lagna.
Nakshatra
A finer division of the zodiac into 27 lunar mansions. Each has its own deity and its own image.
exalted
A graha stands in the sign where it acts most strongly. The opposite is debilitated.
dig bala
Directional strength. Every graha has a house in which it comes into its own.
atmakaraka
The graha at the highest degree in the chart. The tradition reads it as the most important one.
retrograde
A planet moving backwards as seen from Earth. Counts as turned inward, not as weak.

Take it with you

Every file carries all four variants — terminal, editor, and whatever else reads colours. If you only need the values, they are on the palette page; one click copies them.

Install Palette