1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:47:45 +00:00

LibDraw: Parse some more color string formats found on the web

This patch adds the 17 color names from CSS2.1, as well as support for
the "#rgb" shorthand where each component is a hex digit that gets
multiplied by 17.
This commit is contained in:
Andreas Kling 2019-10-06 21:35:56 +02:00
parent 66caa7af2b
commit 122d12e617
3 changed files with 53 additions and 13 deletions

View file

@ -3,22 +3,22 @@
<title>Selector test</title>
<style>
#foo #bar #baz {
background-color: #00ff00;
background-color: lime;
}
.abc .def div {
background-color: #ffffff;
background-color: white;
border-style: solid;
border-width: 1;
border-color: #00ff00;
border-color: lime;
}
div > .boo > .bee {
background-color: #000000;
color: #ff00ff;
background-color: black;
color: magenta;
}
#gen_sib ~ div,
#adj_sib + div {
background-color: #0000ff;
color: #ffffff;
background-color: blue;
color: white;
}
</style>
</head>

View file

@ -3,11 +3,11 @@
<title>Welcome!</title>
<style type="text/css">
body {
background-color: #ffffff;
color: #000000;
background-color: #fff;
color: #000;
}
h1 {
color: #800000;
color: #800;
}
</style>
</head>