顏色轉換工具(HEX/RGB/HSL)
在HEX、RGB和HSL格式之間轉換顏色。可視化選取顏色,或手動輸入數值。
#535bebrgb(83, 91, 235)hsl(237, 79%, 62%)如何使用本工具
- 1
Click the color swatch to open your operating system's color picker and choose a color visually.
- 2
Or type a 6-digit HEX value (such as #535beb, with or without the leading #) into the text field.
- 3
Read the matching rgb(R, G, B) and hsl(H, S%, L%) strings in the result cards below.
- 4
Copy whichever format you need straight into your CSS or design file.
什麼是顏色轉換工具(HEX/RGB/HSL)?
HEX、RGB和HSL是表達同一種顏色的三種方式。HEX(#RRGGBB)在CSS和設計工具中最為常見。RGB(rgb(R,G,B))以數值方式分離各通道。HSL(hsl(H,S%,L%))對人來說更直觀:色相(hue)是顏色本身,飽和度是色彩強度,明度(lightness)則是亮度。設計配色方案時使用HSL;在實作時再轉換為HEX。
常見使用場景
Translating a brand HEX code from a style guide into the rgb() values a legacy stylesheet or email template requires.
Grabbing the HSL form of a color so you can nudge its lightness or saturation while keeping the same hue for a palette.
Checking the exact RGB channels of a color picked from a screenshot or mockup before writing it into CSS.
Confirming what a designer's HEX swatch becomes in RGB for a canvas, SVG, or charting library that wants numeric channels.
Teaching or learning how hexadecimal color notation maps to decimal RGB and to the HSL model.
Quickly sampling a color visually with the picker and reading all three CSS-ready notations at once.
常見問題
我應該在什麼時候用HSL而不是HEX?▼
OKLCH和現代顏色空間呢?▼
相關工具
CSS Box Shadow 產生器
以視覺化方式建立 CSS box-shadow 值。即時預覽並複製產生的 CSS。
CSS漸層產生器
建立線性和放射狀CSS漸層。以視覺化方式選擇顏色,並複製產生的CSS。
Cubic Bezier緩動曲線產生器
為CSS建立cubic-bezier緩動曲線。內建標準預設。
配色方案產生器
從任意基準色產生和諧的配色方案。支援互補色、鄰近色、三角色和單色方案。
CSS Border Radius 產生器
以視覺化方式建立複雜的 CSS border-radius 值。可獨立控制每個圓角。
CSS Clamp()產生器
使用clamp()產生流式、響應式的CSS數值。在視口範圍內於最小值與最大值之間平滑縮放。