Steel blue #2E86C1
- 颜色
- #2E86C1
- RGB
- rgb(46, 134, 193)
- HSL
- hsl(204.1, 61.5%, 46.9%)
- HSV / HSB
- hsv(204.1, 76.2%, 75.7%)
- CMYK
- cmyk(76.2%, 30.6%, 0.0%, 24.3%)
核验来源:Python 3.8 colorsys.rgb_to_hls / rgb_to_hsv on (46, 134, 193)/255, formatted to 1 dp
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.
更新于 已验证的示例:6
#2E86C1 is hsl(204.1, 61.5%, 46.9%) in HSL: hue 204°, 62% saturation, 47% lightness. The closest CSS name is “steelblue” (#4682B4).
Read as hex.
This is the textbook formula with no ink limit or printer profile.
Uses the IEC 61966-2-1 transfer curve and the CSS Color 4 sRGB-to-XYZ matrix.
CSS lab() uses a D50 white instead, so its numbers differ slightly from these D65 values.
LMS cone responses are cube-rooted between Ottosson's two matrices.
Distance is the straight-line gap in OKLab. CSS Color 4 treats 0.02 as a just-noticeable difference in its gamut-mapping algorithm.
The converter reads any CSS color notation into sRGB channels between 0 and 1, then derives each format from them: HEX and RGB scale the channels to 0–255, HSL and HSV come from the largest and smallest channel, and CMYK sets K = 1 − max(R, G, B). For CIE Lab and OKLCH it first removes the sRGB gamma curve of IEC 61966-2-1, converts to CIE XYZ with the D65 white point, then applies the CIE 15 and Ottosson (2020) formulas.
Designers and front-end developers use it to move a color between CSS, design tools and print specs. The default, #2E86C1, is rgb(46, 134, 193), hsl(204.1, 61.5%, 46.9%) and oklch(59.57% 0.1217 242.57), and its nearest CSS named color is steelblue (#4682B4).
CMYK here is the plain formula with no printer profile, so a print shop's values will differ.
核验来源:Python 3.8 colorsys.rgb_to_hls / rgb_to_hsv on (46, 134, 193)/255, formatted to 1 dp
核验来源:Separate Python 3.8 decimal script of the CIE 15 Lab (D65) and Ottosson OKLab formulas; matches Bruce Lindbloom's sRGB/D65 red (53.24, 80.09, 67.20) and CSS Color 4's oklch(62.8% 0.2577 29.23)
核验来源:Python 3.8 colorsys.hls_to_rgb(1/3, 0.251, 1.0) × 255 = (0, 128.01, 0) → #008000; CSS Color 4 §6.1 green = #008000
核验来源:Definition: max = min = 1 gives zero saturation and chroma; CSS Color 4 treats the hue of an achromatic color as powerless (none)
Split the six hex digits into three pairs and convert each pair from base 16 to decimal: #2E86C1 is 2E = 46, 86 = 134 and C1 = 193, so rgb(46, 134, 193). A three-digit shorthand doubles each digit, so #F80 means #FF8800. To go the other way, write each 0–255 channel as two hex digits, padding with a leading 0 below 16.
Both use the same hue angle but define the other two values differently. HSL lightness is the average of the largest and smallest channel, so pure colors sit at 50% and white at 100%; HSV value is the largest channel, so pure colors sit at 100%. #2E86C1 is hsl(204.1, 61.5%, 46.9%) but hsv(204.1, 76.2%, 75.7%). CSS has hsl() and hwb() but no hsv().
A plain conversion only rearranges screen RGB: K = 1 − max(R, G, B) and each ink is (1 − channel − K) ÷ (1 − K), with no knowledge of paper, ink or press. Print workflows convert through an ICC profile such as FOGRA39 or GRACoL 2006, which limits total ink coverage and shifts colors, so treat these numbers as a starting point and ask the printer for their profile.
OKLCH is the polar form of Björn Ottosson's 2020 OKLab space: lightness L, chroma C and hue h. Equal steps in L look about equally different in brightness across hues, which HSL does not manage, so it suits palettes and accessible color scales. CSS Color Level 4 defines oklch(), and every major browser has supported it since 2023. Pure red is oklch(62.8% 0.2577 29.23).
Relative luminance is a color's brightness on a scale from 0 (black) to 1 (white), computed on linear channels after removing the sRGB gamma curve: L = 0.2126 R + 0.7152 G + 0.0722 B. Green weighs most because the eye is most sensitive to it, so pure red scores 0.2126 and #2E86C1 scores 0.2148. WCAG uses it for contrast ratios, (L1 + 0.05) ÷ (L2 + 0.05).
准确性取决于输入值和方法的假设。十进制运算使用50位有效数字,但估算、数值方法和源数据的精度可能较低;显示时的舍入并不能消除这些限制。 已按独立来源核验的计算示例:6。 例如,“Steel blue #2E86C1”根据Python 3.8 colorsys.rgb_to_hls / rgb_to_hsv on (46, 134, 193)/255, formatted to 1 dp进行核验。
W3C CSS Color Module Level 4 — sRGB, HSL, HWB conversions and sample code; IEC 61966-2-1:1999 — Default RGB colour space sRGB; CIE 15:2004 Colorimetry, 3rd ed. — CIELAB (ε = 216/24389, κ = 24389/27); Björn Ottosson (2020), A perceptual color space for image processing (OKLab).
此计算器包含 6 个已解示例,答案来自独立来源。这些示例会在测试套件中运行,你也可以在此运行验证。
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.
Generate complementary, analogous, triadic, split-complementary, tetradic or monochromatic color palettes from one base color, with HEX codes.
How a color looks with protanopia, deuteranopia or tritanopia (red, green or blue color blindness), using the Machado et al. (2009) model.