--- id: css-hsl-colors title: "CSS HSL Colors" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["HSL", "hsl()", "HSLA", "hsla()", "hue saturation lightness", "CSS HSL values"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.88 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["css", "web", "frontend", "w3schools", "color", "hsl", "hsla"] raw_sources: ["https://www.w3schools.com/css/css_colors_hsl.asp"] applied_in: [] github_commit: "" --- # [[CSS HSL Colors]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) HSL specifies a color by hue, saturation, and lightness β€” `hsl(hue, saturation, lightness)` β€” and `hsla()` adds an alpha channel (0.0–1.0) for opacity. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **HSL = Hue, Saturation, Lightness.** [S1] - **Syntax** β€” `hsl(hue, saturation, lightness)`. [S1] - **Hue** β€” a degree on the color wheel from 0 to 360: 0 (or 360) is red, 120 is green, 240 is blue. [S1] - **Saturation** β€” a percentage value: 0% means a shade of gray, and 100% is the full color. [S1] - **Lightness** β€” a percentage: 0% is black, 50% is neither dark nor light, 100% is white. [S1] - **HSLA** β€” extends HSL with an alpha channel for opacity: `hsla(hue, saturation, lightness, alpha)`, alpha 0.0 (transparent) to 1.0 (opaque). [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Saturation controls vividness** β€” lowering saturation toward 0% washes a color out toward gray while keeping hue and lightness fixed. [S1] - **Lightness controls brightness** β€” sweeping lightness from 0% to 100% moves any hue from black through full color to white. [S1] - **Gray via HSL** β€” set hue and saturation to 0 and vary only lightness to produce shades of gray. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **HSL Value** HSL stands for hue, saturation, and lightness. An HSL color value is specified with `hsl(hue, saturation, lightness)`. Hue is a degree on the color wheel from 0 to 360, where 0 is red, 120 is green, and 240 is blue. Saturation is a percentage value: 0% means a shade of gray, and 100% is the full color. Lightness is also a percentage: 0% is black, 50% is neither dark nor light, and 100% is white. [S1] **Saturation** With hue at 0 (red) and lightness at 50%, varying the saturation demonstrates the effect: [S1] ```css hsl(0, 100%, 50%) hsl(0, 80%, 50%) hsl(0, 60%, 50%) hsl(0, 40%, 50%) hsl(0, 20%, 50%) hsl(0, 0%, 50%) ``` **Lightness** With hue at 0 (red) and saturation at 100%, varying the lightness demonstrates the effect from no light (black) through full color to full lightness (white). The page shows this across lightness values ranging from 0% to 100%: [S1] ```css hsl(0, 100%, 0%) /* 0% = black */ hsl(0, 100%, 100%) /* 100% = white */ ``` (Intermediate lightness swatches appear on the page but their exact numeric values are: Not found in source.) **Shades of Gray** Shades of gray are often defined by setting the hue and saturation to 0 and adjusting the lightness from 0% (black) to 100% (white): [S1] ```css hsl(0, 0%, 0%) /* black */ hsl(0, 0%, 100%) /* white */ ``` (Intermediate gray lightness values between these endpoints are shown as swatches on the page but their exact numeric values are: Not found in source.) **HSLA Value** HSLA color values are an extension of HSL with an alpha channel, which specifies the opacity for a color. An HSLA color value is specified with `hsla(hue, saturation, lightness, alpha)`, where the alpha parameter is a number between 0.0 (fully transparent) and 1.0 (not transparent at all). [S1] The page demonstrates the same color at increasing opacity: [S1] ```css hsla(9, 100%, 64%, 0) hsla(9, 100%, 64%, 0.2) hsla(9, 100%, 64%, 0.4) hsla(9, 100%, 64%, 0.6) hsla(9, 100%, 64%, 0.8) hsla(9, 100%, 64%, 1) ``` ## πŸ› οΈ 적용 사둀 (Applied in summary) The color values above are the page's own demonstration examples. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) HSL function (language: CSS): ```css selector { color: hsl(hue, saturation, lightness); /* hue 0–360; sat/light 0%–100% */ } ``` HSLA function with opacity: ```css selector { color: hsla(hue, saturation, lightness, alpha); /* alpha 0.0–1.0 */ } ``` ## βš–οΈ 비ꡐ 및 선택 κΈ°μ€€ (Comparison & decision criteria) - **HSL vs HSLA** β€” use `hsl()` for an opaque color described intuitively by hue/saturation/lightness; use `hsla()` when an opacity (alpha) value from 0.0 to 1.0 is also required. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) No contradictions found in the source. ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.88 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS RGB]], [[CSS HEX]], [[CSS Colors]], [[CSS Background Color]] - **μ°Έμ‘° λ§₯락:** Referenced whenever a color is described perceptually by hue, saturation, and lightness, or when an opacity channel is needed via HSLA. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS HSL Colors β€” https://www.w3schools.com/css/css_colors_hsl.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS HSL Colors" page (Astra wiki-curation, P-Reinforce v3.1 format).