
Newsletter Subscribe
Enter your email address below and subscribe to our newsletter

Enter your email address below and subscribe to our newsletter
Build a balanced five-color scheme from one base color using complementary, analogous or triadic harmony rules.
Build a balanced five-color scheme from one base color using complementary, analogous or triadic harmony rules.
The five swatches are generated from HSL hue arithmetic. Contrast values are measured against white text using the WCAG relative-luminance formula.
Everything runs in your browser. No data is uploaded.
Choosing colours for a room usually starts with a single swatch: a fabric sample, a paint chip, a tile or a photographed object. The difficulty is that a single colour does not describe a scheme on its own. This generator takes one base colour supplied as a hexadecimal code and builds a small, ordered set of related swatches from it, so that a starting point can be turned into a repeatable palette rather than a collection of unrelated guesses. The default base used throughout this page is the hexadecimal value #8A6F52, a muted mid-brown, but any valid six-digit hexadecimal value is accepted.
The calculation runs in four stages. First the hexadecimal code is read as three two-digit hexadecimal channels and converted into a red, green and blue triple. Second those three numbers are converted into the hue, saturation and lightness representation, with hue expressed as an angle in degrees and saturation and lightness as percentages. Third the selected harmony rule is applied as one or more angular offsets to that hue, which produces the partner colours; a lightened variant and a darkened variant are then added by adjusting lightness by a fixed amount and clamping the result to the permitted range. Fourth the generator computes a contrast ratio between each swatch and white, using the relative-luminance formula published for web content accessibility, and reports that ratio alongside the swatch.
The output is a base swatch, the harmony partner or partners, one lightened variant at lightness plus eighteen percentage points, one darkened variant at lightness minus eighteen percentage points, and a numeric contrast ratio against white for each. A display preference labelled mood, with the settings light, balanced and dark, changes which lightness variants are emphasised in the presented order; it does not alter the fixed arithmetic described below, so every displayed value remains recomputable by hand.
Everything runs locally in the browser. No colour value is uploaded, stored or used to build a profile, and the result can be reproduced with the formulae in the fourth section. The tool is a colour-arithmetic aid. It makes no claim about any effect that a colour, combination or contrast value might have on a person; the mood control is a lightness label for the numeric output and carries no such meaning.
Descriptions such as “a warmer version of the same brown” or “a colour that sits next to it on the wheel” are useful in conversation but cannot be checked. Without a defined numeric colour space, two people can produce two different palettes from the same instruction and have no way to decide which one follows the rule. A defined space turns the instruction into a calculation. Hue becomes an angle on a circle of three hundred and sixty degrees, so “the opposite colour” becomes the addition of one hundred and eighty degrees and “two neighbours” become additions and subtractions of thirty degrees. The result is repeatable, and a disagreement can be resolved by recomputing it.
The second reason is legibility. A palette is not only a set of hues; it is a set of values that may be placed next to text, icons or adjacent surfaces. Contrast ratio is a measurable quantity derived from relative luminance, and publishing it beside each swatch lets a reader check whether a chosen foreground and background combination is likely to be readable. The calculation used here is the standard linearised sRGB relative-luminance formula, so the number is comparable with the guidance published for web content rather than being an impression of light or dark.
The third reason is disciplined rounding. Hue angles wrap around at three hundred and sixty degrees, saturation and lightness are bounded between zero and one hundred percent, and a contrast ratio is a quotient that needs a stated number of decimal places. Publishing the rounding and clamping rules means the difference between a result on one device and a result on another is explainable rather than mysterious. Small discrepancies usually come from a rounding boundary, not from a different method.
None of this assigns meaning to a colour. The generator treats colour as numbers in a specified colour space. It does not rank schemes as attractive or suitable for a particular purpose, and it offers no assessment of how a colour will appear to a person. Any such interpretation belongs to the reader and to the physical materials involved, not to the arithmetic.
The first table lists the five harmony rules used by the generator, expressed purely as angular offsets from the base hue. The offsets are long-standing colour-wheel design conventions rather than a published technical standard, and they are stated here so that any result can be checked. The column of resulting angles assumes the default base hue of thirty-one degrees, which is derived from the hexadecimal base value in the worked examples below.
| Harmony rule | Hue offset from base | Resulting angle(s) for a 31 deg base | Partner swatches |
|---|---|---|---|
| Complementary | +180 | 211 deg | One |
| Analogous | -30 and +30 | 1 deg and 61 deg | Two |
| Triadic | +120 and +240 | 151 deg and 271 deg | Two |
| Split-complementary | +150 and +210 | 181 deg and 241 deg | Two |
| Monochromatic | 0, with saturation and lightness varied | 31 deg | Varied values of one hue |
The second table records the relative-luminance and contrast figures used in the worked example. Relative luminance is computed from linearised sRGB channels, and the contrast ratio is the quotient of the lighter and darker luminance values each increased by zero point zero five. White is taken as the reference with relative luminance one. These are computed values, not measured product data.
| Colour | sRGB (R, G, B) | Relative luminance | Contrast against white |
|---|---|---|---|
| White | (255, 255, 255) | 1.000 | 1.00:1 |
| Black | (0, 0, 0) | 0.000 | 21.00:1 |
| Default base #8A6F52 | (138, 111, 82) | 0.174 | 4.69:1 |
The W3C publishes minimum contrast thresholds for text legibility in its contrast-minimum guidance, commonly quoted as four point five to one for normal text and three to one for large text. Those are published values of that standard, reproduced here only for orientation; they are not constants invented for this tool, and the tool does not certify conformance with them.
Every rule below is stated explicitly so that a reader can recompute each swatch and each contrast ratio from the base value alone. The assumed input colour space is sRGB with eight-bit channels.
A six-digit hexadecimal code is split into three pairs. Each pair is read as a base-sixteen integer in the range zero to two hundred and fifty-five. For the default #8A6F52 the pairs are 8A, 6F and 52, which decode to one hundred and thirty-eight, one hundred and eleven, and eighty-two. The conversion is exact and involves no rounding.
The three channels are first normalised by dividing by two hundred and fifty-five. Let the largest normalised channel be max and the smallest be min. Lightness is defined as L = (max + min) / 2. The difference between the largest and smallest channels is delta = max – min. When delta is zero the colour is achromatic, hue and saturation are both zero. Otherwise saturation is S = delta / (1 – |2L – 1|). Hue depends on which channel is largest: when red is largest, H = 60 x (((green – blue) / delta) mod 6); when green is largest, H = 60 x (((blue – red) / delta) + 2); when blue is largest, H = 60 x (((red – green) / delta) + 4). Hue is expressed in degrees and is reduced modulo three hundred and sixty so that it always lies between zero and three hundred and sixty. Saturation and lightness are expressed as percentages between zero and one hundred.
Each harmony rule adds a fixed offset to the base hue and reduces the result modulo three hundred and sixty. Complementary adds one hundred and eighty. Analogous adds minus thirty and plus thirty. Triadic adds one hundred and twenty and two hundred and forty. Split-complementary adds one hundred and fifty and two hundred and ten. Monochromatic keeps the hue unchanged and varies saturation and lightness instead. Saturation and lightness of the partner swatches are inherited from the base unless the monochromatic rule is selected. The offsets are applied to the rounded base hue, so the arithmetic shown in the worked examples can be followed with whole degrees.
Two further swatches are produced from the base. A lightened variant takes the base lightness plus eighteen percentage points, and a darkened variant takes the base lightness minus eighteen percentage points. Hue and saturation are unchanged. Both results are clamped to the range zero to one hundred percent, so a lightness of ninety-five would produce a lightened variant clamped to one hundred, and a lightness of ten would produce a darkened variant clamped to zero. Clamping is applied after the addition or subtraction, never to the base value itself.
Each of the three sRGB channels is linearised before luminance is computed. For a normalised channel c, the linearised value is c / 12.92 when c is at or below zero point zero four zero four five, and ((c + 0.055) / 1.055) raised to the power of two point four otherwise. Relative luminance is L = 0.2126 x red + 0.7152 x green + 0.0722 x blue, using the linearised channels. White has a relative luminance of one. The contrast ratio is (L_lighter + 0.05) / (L_darker + 0.05), where the lighter value is the larger of the two luminances. The result is a dimensionless ratio between one and twenty-one.
Hue is displayed rounded to the nearest whole degree, saturation and lightness to the nearest whole percent, and the contrast ratio to two decimal places. Fixture-like quantities do not arise in this tool, so no ceiling rounding is used. When two results are equally close to a rounding boundary, the higher value is shown. These conventions are declared so that a recomputation matches the displayed figure exactly.
The three examples below use only the default base value and the published formula. Every number can be reproduced with a short Python script. Worked examples are expressed as hue-saturation-lightness arithmetic in degrees and percentages; no derived hexadecimal code is printed, because converting a partner swatch back to hexadecimal would require an additional, separately computed step.
Start with #8A6F52, which decodes to the red, green and blue triple (138, 111, 82). Normalised, the channels are approximately 0.54118, 0.43529 and 0.32157, so max is 0.54118, min is 0.32157 and delta is 0.21961. Lightness is (0.54118 + 0.32157) / 2 = 0.43137, or 43.14 percent, which rounds to 43 percent. The denominator for saturation is 1 – |2 x 0.43137 – 1| = 0.86275, so saturation is 0.21961 / 0.86275 = 25.45 percent, which rounds to 25 percent. Red is the largest channel, so hue is 60 x (((0.43529 – 0.32157) / 0.21961) mod 6) = 60 x 0.51786 = 31.07 degrees, which rounds to 31 degrees. The base is therefore reported as approximately hue 31 degrees, saturation 25 percent, lightness 43 percent.
Applying the complementary rule adds one hundred and eighty degrees: 31 + 180 = 211 degrees, so the partner swatch is approximately hue 211 degrees, saturation 25 percent, lightness 43 percent. The lightened variant takes 43 + 18 = 61 percent lightness, and the darkened variant takes 43 – 18 = 25 percent lightness; both fall inside the zero to one hundred clamp and are used unchanged. All three derived swatches keep saturation at 25 percent, and the lightened and darkened variants keep hue at 31 degrees.
Keeping the same rounded base hue of 31 degrees, the remaining rules are ordinary additions reduced modulo three hundred and sixty. Analogous gives 31 – 30 = 1 degree and 31 + 30 = 61 degrees. Triadic gives 31 + 120 = 151 degrees and 31 + 240 = 271 degrees. Split-complementary gives 31 + 150 = 181 degrees and 31 + 210 = 241 degrees. Monochromatic keeps the hue at 31 degrees and instead varies saturation and lightness, which is why it is listed with a zero offset in the reference table. None of these additions crosses the three hundred and sixty degree wrap in this particular case, but the modulo operation would apply if a base hue above one hundred and eighty degrees were used with the complementary or triadic rules. Each partner inherits the base saturation of 25 percent and base lightness of 43 percent.
Using the same red, green and blue triple (138, 111, 82), each channel is linearised. The red channel gives 0.254152, the green channel 0.158961 and the blue channel 0.084376. Relative luminance is 0.2126 x 0.254152 + 0.7152 x 0.158961 + 0.0722 x 0.084376 = 0.173813. White has relative luminance 1.0. Because white is the lighter value, the contrast ratio is (1.0 + 0.05) / (0.173813 + 0.05) = 1.05 / 0.223813 = 4.6914, which is displayed as 4.69:1. As a check, black against white gives (1.0 + 0.05) / (0.0 + 0.05) = 21.00:1, the upper end of the scale, and white against white gives (1.0 + 0.05) / (1.0 + 0.05) = 1.00:1, the lower end.
Good output depends on a base value that genuinely represents the colour being planned. The following procedure keeps the input honest and the result reproducible.
Avoid using a colour picker over a compressed image as the source, because compression alters channel values around edges. Equally, avoid taking a value from a screen with an unknown colour profile as an exact match for a physical paint or fabric; the numeric result will be correct for the displayed value, but a printed or dyed sample is a separate material with its own appearance.
The calculation assumes eight-bit sRGB as the input colour space. Values supplied in another space, or values taken from a profiled image without conversion, will not produce the same channel triple. Hue, saturation and lightness are a geometric re-expression of the red, green and blue numbers, not a perceptual colour model; equal numeric steps in lightness are not guaranteed to look equal. The harmony offsets are design conventions rather than a published technical standard, and they are applied to the rounded base hue.
The tool computes a contrast ratio against white only. It does not evaluate contrast between two arbitrary swatches, against a coloured background, or under a specific viewing condition, and it does not certify conformance with any accessibility criterion. The relative-luminance formula and the published WCAG thresholds are separate matters: the tool reports a number, while conformance is a broader judgement about the finished content.
The generator does not model gamut limitations, printing inks, dye lots, metamerism, surface gloss, lighting conditions, colour management profiles or the appearance of a colour on a particular display. Monochromatic output varies saturation and lightness only, so it does not attempt to match a named colour system or a proprietary swatch library. It offers no interpretation of colour meaning and no aesthetic ranking.
The output is a numeric starting point, not a finished specification. Treat it as one input alongside physical samples, the finished material and the conditions of the space. The tool provides no assessment of any kind beyond the arithmetic published here, and no result should be read as professional advice.
It adds fixed angular offsets to the base hue and reduces the result modulo three hundred and sixty degrees. Saturation and lightness of the partner swatches are inherited from the base, except under the monochromatic rule, where saturation and lightness are varied instead of hue.
The exact hue computed from the default base is about 31.07 degrees. Displayed values are rounded to the nearest whole degree, so the tool reports thirty-one. The worked example shows the full calculation leading to that rounded figure.
Converting a hue-saturation-lightness result back to a hexadecimal value requires an additional computation that is separate from the angle arithmetic. To keep every printed number directly recomputable from the stated formula, the examples are expressed in degrees and percentages only.
The result is clamped to the nearest bound. A lightened value above one hundred becomes one hundred, and a darkened value below zero becomes zero. Clamping happens after the eighteen-point adjustment and never changes the base value.
No. It is a quotient of relative luminances computed against a white reference. It is a legibility quantity for a foreground and a white background, not a judgement about the relationship between palette swatches or about appearance in a room.
It changes which lightness variants are emphasised in the presented order. The lightened and darkened values remain lightness plus eighteen and minus eighteen, so the underlying arithmetic and every reported number stay the same regardless of the setting.
A value can be entered, but a photograph is affected by camera, lighting and white balance. A manufacturer code or a saved hexadecimal value is a more reliable starting point, because the result is only as consistent as the number supplied to it.
Monochromatic keeps the hue fixed. Instead of adding an angle, it varies saturation and lightness, so the angular offset column records zero and the partner swatches differ in value rather than in hue.
The tool reports contrast ratios to two decimal places, using the higher value when a result sits exactly on a rounding boundary. Recomputing with the stated relative-luminance formula and white reference reproduces the displayed figure.
The colour-space conversions, the harmony offsets and the relative-luminance formula used above are general published conventions rather than a single mandatory standard for interior palettes. The following public references are provided so that the underlying colour-management terminology, colour systems and contrast calculation can be checked independently. Links are for verification only and are not an endorsement of any product, organisation or retailer, and none of these sources states the specific constants used by this tool.
This tool provides general planning guidance for informational purposes only. It does not constitute professional advice or an assessment of any specific product, property or installation. Results are estimates derived from the assumptions published on this page. Always check the figures against current product specifications and the conditions of the space, and consult a suitably qualified professional where a specific decision requires one.