von Thomas Salvador.
Graustufen gehören zu den unbunten Farben und zeichnen sich dadurch aus, dass ihre Farbwerte für Rot, Grün und Blau gleich sind.
Graustufen enthalten natürlich alle 16 Graustufen und insbesondere die unbunten Grundfarben Schwarz und Weiß.
Um 256 Graustufen in HTML bzw. CSS zu erzeugen, wählen wir Farbwerte rr, gg und bb mit Werten von 0 bis 255 (d.h. hexadezimal 00 bis ff).
Hintergrundfarbwert #0a0a0a | Schriftfarbwert #cfcfcf | |||||
Detail | : | Hintergrund #0a0a0a | Detail | : | Schrift #cfcfcf | |
Farbwert | : | #0a0a0a | Farbwert | : | #cfcfcf | |
Farbe | : | gray10 | Farbe | : | gray207 | |
HTML | : | #0a0a0a | HTML | : | #cfcfcf | |
HTML (Wert) | : | #0a0a0a | HTML (Wert) | : | #cfcfcf | |
CSS | : | #0a0a0a | CSS | : | #cfcfcf | |
CSS (Wert) | : | #0a0a0a | CSS (Wert) | : | #cfcfcf | |
CSS (kürzest) | : | #0a0a0a | CSS (kürzest) | : | #cfcfcf | |
CSS (RGB) | : | rgb(10,10,10) | CSS (RGB) | : | rgb(207,207,207) | |
CSS (%RGB) | : | rgb(3%,3%,3%) | CSS (%RGB) | : | rgb(81%,81%,81%) |
Verlauf Hintergrundfarbwert #0a0a0a nach Schriftfarbwert #cfcfcf | |||||||
#0a0a0a | #262626 | #424242 | #5e5e5e | #7a7a7a | #969696 | #b2b2b2 | #cfcfcf |
#0a0a0a | #262626 | #424242 | #5e5e5e | #7a7a7a | #969696 | #b2b2b2 | #cfcfcf |
Kombination von #0a0a0a und #cfcfcf | |||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dapibus, lorem sed bibendum consectetur, ligula enim dignissim ligula, a ultrices dolor augue ultrices magna. Cras id velit ante. Suspendisse augue erat, auctor ut ultricies non, facilisis sed neque. Cras vestibulum tristique erat, ac interdum justo cursus in. | Die Ähnlichkeit der Farben #cfcfcf und #0a0a0a ergibt sich zu 39.49%. Die Lesbarkeit dieser Kombination von Farben ergibt sich zu 60.51%. #cfcfcf eignet sich als Schriftfarbe auf Hintergrund #0a0a0a, weil Unterschied in den Helligkeiten und Farbenunterschied in Ordnung sind. |
Hintergrundfarbwert #0a0a0a | Schriftfarbwert #cfcfcf | ||||||
Verlauf nach Weiß | Verlauf nach Schwarz | Verlauf nach Weiß | Verlauf nach Schwarz | ||||
#0a0a0a | #0a0a0a | #0a0a0a | #0a0a0a | #cfcfcf | #cfcfcf | #cfcfcf | #cfcfcf |
#2d2d2d | #2d2d2d | #080808 | #080808 | #d5d5d5 | #d5d5d5 | #b1b1b1 | #b1b1b1 |
#505050 | #505050 | #070707 | #070707 | #dcdcdc | #dcdcdc | #939393 | #939393 |
#737373 | #737373 | #050505 | #050505 | #e3e3e3 | #e3e3e3 | #767676 | #767676 |
#969696 | #969696 | #040404 | #040404 | #eaeaea | #eaeaea | #585858 | #585858 |
#b9b9b9 | #b9b9b9 | #020202 | #020202 | #f1f1f1 | #f1f1f1 | #3b3b3b | #3b3b3b |
#dcdcdc | #dcdcdc | #010101 | #010101 | #f8f8f8 | #f8f8f8 | #1d1d1d | #1d1d1d |
#ffffff | #ffffff | #000000 | #000000 | #ffffff | #ffffff | #000000 | #000000 |
Die Textfarbe soll sich von Farbwert #0a0a0a auf Farbwert #cfcfcf ändern, wenn man mit der Maus darauf zeigt. Wir bereiten zunächst eine Formatierung von <pre> in Farbwert #0a0a0a vor.
In diesem Beispiel ändern wir die Textfarbe von <pre> auf Farbwert #0a0a0a und setzen die Schriftgröße auf 9pt.
<style type="text/css"><!-- pre { color:#0a0a0a; font-size:9pt; } //--> </style>Nun fordern wir, dass bei Berührung mit der Maus die Textfarbe auf #cfcfcf gesetzt wird.
<style type="text/css"><!-- pre: hover { color: #cfcfcf; } //--> </style>
Weiteres zum Thema pre lesen Sie in Blockorientierte Elemente in HTML. Weiteres zum Befehl pre lesen Sie in der HTML Referenz unter <pre>.