सीएसएस एचएसएल () समारोह
उदाहरण
विभिन्न एचएसएल रंगों को परिभाषित करें:
#p1 {background-color:hsl(120,100%,50%);} /* green */
#p2 {background-color:hsl(120,100%,75%);} /* light green */
#p3 {background-color:hsl(120,100%,25%);} /* dark green */
#p4 {background-color:hsl(120,60%,70%);} /* pastel green */
परिभाषा और उपयोग
hsl() फ़ंक्शन ह्यू-संतृप्ति-लपट मॉडल (HSL) का उपयोग करके रंगों को परिभाषित करता है।
एचएसएल रंग, संतृप्ति और हल्कापन के लिए खड़ा है - और रंगों के बेलनाकार-समन्वय प्रतिनिधित्व का प्रतिनिधित्व करता है।
संस्करण: | CSS3 |
---|
ब्राउज़र समर्थन
तालिका में संख्याएं पहले ब्राउज़र संस्करण को निर्दिष्ट करती हैं जो फ़ंक्शन का पूर्ण समर्थन करता है।
Function | |||||
---|---|---|---|---|---|
hsl() | 1.0 | 9.0 | 1.0 | 3.1 | 9.5 |
सीएसएस सिंटेक्स
hsl(hue, saturation, lightness)
Value | Description |
---|---|
hue | Defines a degree on the color wheel (from 0 to 360) - 0 (or 360) is red, 120 is green, 240 is blue |
saturation | Defines the saturation; 0% is a shade of gray and 100% is the full color (full saturation) |
lightness | Defines the lightness; 0% is black, 50% is normal, and 100% is white |