Kleuren HWB


HWB (Hue, Whiteness, Blackness) is een voorgestelde standaard voor CSS4.


HWB-calculator


 
RGB(255, 0, 0)
#ff0000
hsl(0, 100%, 50%)


H:
W:
B:
"; } x += ""; x += ""; n = 0; for (i = 0; i "; } x += ""; x += ""; document.getElementById("huetable"). innerHTML = x; } function drawWhiteTable(hue) { var x, i; x = "" x += ""; for (i = 0; i "; } x += ""; x += ""; for ( ik = 0; ik "; } x += "
" + i + "
"; document.getElementById("whitetable").innerHTML = x; } function drawBlackTable(hue) { var x, i; x = "" x += ""; for (i = 0; i "; } x += ""; x += ""; voor (i = 0; i "; } x += "
" + i + "
"; document.getElementById("blacktable").innerHTML = x; } drawWhiteTable(0); drawHueTable(0); drawBlackTable(0);

HTML-ondersteuning

HWB wordt (nog) niet ondersteund in HTML, maar wordt wel voorgesteld als een nieuwe standaard in CSS4.

Terwijl u wacht op CSS4, kunt u de kleurenbibliotheek van W3Schools opnemen en HWB als een HTML-attribuut als volgt gebruiken:

Voorbeeld

<div data-w3-color="hwb(60, 50%, 0)">

<p>London is the capital city of England.
It is the most populous city in the United Kingdom,
with a metropolitan area of over 13 million inhabitants.</p>

</div>

<script src="/lib/w3color.js"></script>

W3Schools-kleurenbibliotheek

De JavaScript-bibliotheek die in het bovenstaande voorbeeld wordt gebruikt, kan worden gedownload van:

https://www.w3schools.com/lib/w3color.js


❮ Vorig Volgende ❯