Complement of red
- Base color
- #FF0000
- Scheme
- Complementary (opposite hue)
- Palette
- #FF0000, #00FFFF
- Colors
- 2
核验来源:Python 3.8 colorsys and an exact fractions version of CSS Color 4 hslToRgb: hue 0° + 180° → (0, 1, 1)
Generate complementary, analogous, triadic, split-complementary, tetradic or monochromatic color palettes from one base color, with HEX codes.
更新于 已验证的示例:6
A triadic palette from #2E86C1: #2E86C1, #C12E86, #86C12E. The hues sit at 204.1°, 324.1°, 84.1° on the HSL wheel with saturation and lightness unchanged.
Each color keeps the base saturation 61.5% and lightness 46.9% and turns the hue by +120°, +240°.
Base: hsl(204.1, 61.5%, 46.9%) → #2E86C1; +120°: hsl(324.1, 61.5%, 46.9%) → #C12E86; +240°: hsl(84.1, 61.5%, 46.9%) → #86C12E
Channels are rounded half up to whole 8-bit values.
Each harmony scheme turns the base color's hue around the HSL color wheel by fixed angles and keeps its saturation and lightness: 180° for complementary, ±30° for analogous, 120° and 240° for triadic, 180° ± 30° for split-complementary and 90° steps for a tetradic square. The monochromatic scheme keeps the hue and mixes the base toward black for shades and toward white for tints, in equal steps.
Designers use it to find accent colors for a brand, chart or interface. The default, #2E86C1 at hue 204.1°, gives the triadic set #2E86C1, #C12E86 and #86C12E, and its complement is #C1692E at hue 24.1°.
Equal HSL lightness does not mean equal brightness to the eye: in that triad, #86C12E has a relative luminance of 0.434 against 0.150 for #C12E86. Check text and background pairs with a contrast checker before using them.
核验来源:Python 3.8 colorsys and an exact fractions version of CSS Color 4 hslToRgb: hue 0° + 180° → (0, 1, 1)
核验来源:Python 3.8 colorsys and an exact fractions version of CSS Color 4 hslToRgb: hue rotations by 120° and 240°
核验来源:Python 3.8 fractions implementation of CSS Color 4 rgbToHsl/hslToRgb: hue 204.1° ± 30° gives (46, 193, 178.5) and (46, 60.5, 193), rounded half up
核验来源:Python 3.8 fractions implementation of CSS Color 4 hslToRgb: hues 90° and 270° give a channel of exactly 127.5, rounded half up to 0x80 (float colorsys lands at 127.4999…)
Convert the color to HSL, add 180° to the hue, and convert back with the same saturation and lightness. #2E86C1 has hue 204.1°, so its complement has hue 24.1°, which is #C1692E. On this RGB-based wheel the complement of red #FF0000 is cyan #00FFFF; on the painter's red-yellow-blue wheel red pairs with green instead, so results differ between tools.
A triadic scheme uses three hues spaced evenly, 120° apart. A split-complementary scheme keeps the base and replaces its complement with the two hues on either side of it, 150° and 210° from the base when the spread is 30°. From #2E86C1 the triad is #C12E86 and #86C12E, while the split-complementary pair is #C12E3D and #C1B32E, which spreads the hues wider than an analogous set.
A tint is a color mixed with white, a shade is mixed with black, and a tone is mixed with gray. This generator makes tints and shades in equal steps: with 2 steps each, the gray #808080 gives shades #2B2B2B and #555555 and tints #AAAAAA and #D5D5D5. Mixing is done channel by channel in sRGB, so each step changes all three channels by the same fraction.
HSL lightness is a formula on the RGB channels, not a measure of perceived brightness, and the eye is far more sensitive to green than to blue. The triad from #2E86C1 has equal HSL lightness, but relative luminances of 0.215, 0.150 and 0.434. For steps that look even, set lightness in OKLCH instead, which CSS Color Level 4 supports.
Only after checking contrast. WCAG 2.2 asks for at least 4.5:1 between normal text and its background, and 3:1 for large text and interface parts. On white, #C12E86 reaches 5.25:1 and passes, #2E86C1 reaches 3.97:1 and suits only large text, and #86C12E reaches 2.17:1 and fails, so use it for fills and borders rather than text.
准确性取决于输入值和方法的假设。十进制运算使用50位有效数字,但估算、数值方法和源数据的精度可能较低;显示时的舍入并不能消除这些限制。 已按独立来源核验的计算示例:6。 例如,“Complement of red”根据Python 3.8 colorsys and an exact fractions version of CSS Color 4 hslToRgb: hue 0° + 180° → (0, 1, 1)进行核验。
W3C CSS Color Module Level 4 §7 — HSL and the hslToRgb / rgbToHsl algorithms; Johannes Itten, The Art of Color (1961) — color contrasts and harmonic chords.
此计算器包含 6 个已解示例,答案来自独立来源。这些示例会在测试套件中运行,你也可以在此运行验证。
Convert a color from HEX to RGB, HSL, HSV, CMYK, CIE Lab and OKLCH or back, and find its nearest CSS named color and relative luminance.
Check the WCAG 2.2 contrast ratio between a text color and its background, with AA and AAA pass or fail for normal text, large text and UI parts.
How a color looks with protanopia, deuteranopia or tritanopia (red, green or blue color blindness), using the Machado et al. (2009) model.