Colores HWB


HWB (Hue, Whiteness, Blackness) es un estándar sugerido para CSS4.


Calculadora HWB


 
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; } función drawWhiteTable(matiz) { var x, i; x = "" x += ""; for (i = 0; i "; } x += ""; x += ""; for ( yo = 0; yo "; } x += "
" + i + "
"; document.getElementById("whitetable").innerHTML = x; } function dibujarBlackTable(tono) { var x, i; x = "" x += ""; for (i = 0; i "; } x += ""; x += ""; para (i = 0; i "; } x += "
" + i + "
"; document.getElementById("blacktable").innerHTML = x; } drawWhiteTable(0); drawHueTable(0); drawBlackTable(0);

Soporte HTML

HWB no es compatible con HTML (todavía), pero se sugiere como un nuevo estándar en CSS4.

Mientras espera por CSS4, puede incluir la biblioteca de colores de W3Schools y usar HWB como un atributo HTML como este:

Ejemplo

<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>

Biblioteca de colores W3Schools

La biblioteca de JavaScript utilizada en el ejemplo anterior se puede descargar desde

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


❮ Anterior Próximo ❯