Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-color/t422-rgba-values-meaning-b.xht - WPT Dashboard Interop Dashboard
<head>
<title>CSS Test: rgba values</title>
<link rel="match" href="t422-rgba-values-meaning-b-ref.html" />
<meta name="assert" content="Test that the color components in rgba colors are interpreted correctly." />
<style type="text/css"><![CDATA[
table { border-spacing: 0; padding: 0; border: none; }
td { border: none; padding: 0; }
td { width: 1.2em; height: 1.2em; }
]]></style>
</head>
<body>
<p>The following table should have four matching rows changing (in 5 steps) from red at the left to black at the right: (plus a checkerboard at both ends to show where the rows are):</p>
<div style="background: black">
<table border="border">
<tr>
<td style="background: black"> </td>
<td style="background: rgba(255, 0, 0, 1.0)"> </td>
<td style="background: rgba(204, 0, 0, 1.0)"> </td>
<td style="background: rgba(153, 0, 0, 1.0)"> </td>
<td style="background: rgba(102, 0, 0, 1.0)"> </td>
<td style="background: rgba(51, 0, 0, 1.0)"> </td>
<td style="background: rgba(0, 0, 0, 1.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(100%, 0%, 0%, 1.0)"> </td>
<td style="background: rgba(80%, 0%, 0%, 1.0)"> </td>
<td style="background: rgba(60%, 0%, 0%, 1.0)"> </td>
<td style="background: rgba(40%, 0%, 0%, 1.0)"> </td>
<td style="background: rgba(20%, 0%, 0%, 1.0)"> </td>
<td style="background: rgba(0%, 0%, 0%, 1.0)"> </td>
<td style="background: black"> </td>
</tr>
<tr>
<td style="background: black"> </td>
<td style="background: rgba(255, 0, 0, 1.0)"> </td>
<td style="background: rgba(255, 0, 0, 0.8)"> </td>
<td style="background: rgba(255, 0, 0, 0.6)"> </td>
<td style="background: rgba(255, 0, 0, 0.4)"> </td>
<td style="background: rgba(255, 0, 0, 0.2)"> </td>
<td style="background: rgba(255, 0, 0, 0.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(100%, 0%, 0%, 1.0)"> </td>
<td style="background: rgba(100%, 0%, 0%, 0.8)"> </td>
<td style="background: rgba(100%, 0%, 0%, 0.6)"> </td>
<td style="background: rgba(100%, 0%, 0%, 0.4)"> </td>
<td style="background: rgba(100%, 0%, 0%, 0.2)"> </td>
<td style="background: rgba(100%, 0%, 0%, 0.0)"> </td>
<td style="background: black"> </td>
</tr>
</table>
</div>
<p>The following table should have four matching rows changing (in 5 steps) from red at the left to white at the right: (plus a checkerboard at both ends to show where the rows are):</p>
<div style="background: white">
<table border="border">
<tr>
<td style="background: black"> </td>
<td style="background: rgba(255, 0, 0, 1.0)"> </td>
<td style="background: rgba(255, 51, 51, 1.0)"> </td>
<td style="background: rgba(255, 102, 102, 1.0)"> </td>
<td style="background: rgba(255, 153, 153, 1.0)"> </td>
<td style="background: rgba(255, 204, 204, 1.0)"> </td>
<td style="background: rgba(255, 255, 255, 1.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(100%, 0%, 0%, 1.0)"> </td>
<td style="background: rgba(100%, 20%, 20%, 1.0)"> </td>
<td style="background: rgba(100%, 40%, 40%, 1.0)"> </td>
<td style="background: rgba(100%, 60%, 60%, 1.0)"> </td>
<td style="background: rgba(100%, 80%, 80%, 1.0)"> </td>
<td style="background: rgba(100%, 100%, 100%, 1.0)"> </td>
<td style="background: black"> </td>
</tr>
<tr>
<td style="background: black"> </td>
<td style="background: rgba(255, 0, 0, 1.0)"> </td>
<td style="background: rgba(255, 0, 0, 0.8)"> </td>
<td style="background: rgba(255, 0, 0, 0.6)"> </td>
<td style="background: rgba(255, 0, 0, 0.4)"> </td>
<td style="background: rgba(255, 0, 0, 0.2)"> </td>
<td style="background: rgba(255, 0, 0, 0.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(100%, 0%, 0%, 1.0)"> </td>
<td style="background: rgba(100%, 0%, 0%, 0.8)"> </td>
<td style="background: rgba(100%, 0%, 0%, 0.6)"> </td>
<td style="background: rgba(100%, 0%, 0%, 0.4)"> </td>
<td style="background: rgba(100%, 0%, 0%, 0.2)"> </td>
<td style="background: rgba(100%, 0%, 0%, 0.0)"> </td>
<td style="background: black"> </td>
</tr>
</table>
</div>
<p>The following table should have four matching rows changing (in 5 steps) from green at the left to black at the right: (plus a checkerboard at both ends to show where the rows are):</p>
<div style="background: black">
<table border="border">
<tr>
<td style="background: black"> </td>
<td style="background: rgba(0, 255, 0, 1.0)"> </td>
<td style="background: rgba(0, 204, 0, 1.0)"> </td>
<td style="background: rgba(0, 153, 0, 1.0)"> </td>
<td style="background: rgba(0, 102, 0, 1.0)"> </td>
<td style="background: rgba(0, 51, 0, 1.0)"> </td>
<td style="background: rgba(0, 0, 0, 1.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(0%, 100%, 0%, 1.0)"> </td>
<td style="background: rgba(0%, 80%, 0%, 1.0)"> </td>
<td style="background: rgba(0%, 60%, 0%, 1.0)"> </td>
<td style="background: rgba(0%, 40%, 0%, 1.0)"> </td>
<td style="background: rgba(0%, 20%, 0%, 1.0)"> </td>
<td style="background: rgba(0%, 0%, 0%, 1.0)"> </td>
<td style="background: black"> </td>
</tr>
<tr>
<td style="background: black"> </td>
<td style="background: rgba(0, 255, 0, 1.0)"> </td>
<td style="background: rgba(0, 255, 0, 0.8)"> </td>
<td style="background: rgba(0, 255, 0, 0.6)"> </td>
<td style="background: rgba(0, 255, 0, 0.4)"> </td>
<td style="background: rgba(0, 255, 0, 0.2)"> </td>
<td style="background: rgba(0, 255, 0, 0.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(0%, 100%, 0%, 1.0)"> </td>
<td style="background: rgba(0%, 100%, 0%, 0.8)"> </td>
<td style="background: rgba(0%, 100%, 0%, 0.6)"> </td>
<td style="background: rgba(0%, 100%, 0%, 0.4)"> </td>
<td style="background: rgba(0%, 100%, 0%, 0.2)"> </td>
<td style="background: rgba(0%, 100%, 0%, 0.0)"> </td>
<td style="background: black"> </td>
</tr>
</table>
</div>
<p>The following table should have four matching rows changing (in 5 steps) from green at the left to white at the right: (plus a checkerboard at both ends to show where the rows are):</p>
<div style="background: white">
<table border="border">
<tr>
<td style="background: black"> </td>
<td style="background: rgba(0, 255, 0, 1.0)"> </td>
<td style="background: rgba(51, 255, 51, 1.0)"> </td>
<td style="background: rgba(102, 255, 102, 1.0)"> </td>
<td style="background: rgba(153, 255, 153, 1.0)"> </td>
<td style="background: rgba(204, 255, 204, 1.0)"> </td>
<td style="background: rgba(255, 255, 255, 1.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(0%, 100%, 0%, 1.0)"> </td>
<td style="background: rgba(20%, 100%, 20%, 1.0)"> </td>
<td style="background: rgba(40%, 100%, 40%, 1.0)"> </td>
<td style="background: rgba(60%, 100%, 60%, 1.0)"> </td>
<td style="background: rgba(80%, 100%, 80%, 1.0)"> </td>
<td style="background: rgba(100%, 100%, 100%, 1.0)"> </td>
<td style="background: black"> </td>
</tr>
<tr>
<td style="background: black"> </td>
<td style="background: rgba(0, 255, 0, 1.0)"> </td>
<td style="background: rgba(0, 255, 0, 0.8)"> </td>
<td style="background: rgba(0, 255, 0, 0.6)"> </td>
<td style="background: rgba(0, 255, 0, 0.4)"> </td>
<td style="background: rgba(0, 255, 0, 0.2)"> </td>
<td style="background: rgba(0, 255, 0, 0.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(0%, 100%, 0%, 1.0)"> </td>
<td style="background: rgba(0%, 100%, 0%, 0.8)"> </td>
<td style="background: rgba(0%, 100%, 0%, 0.6)"> </td>
<td style="background: rgba(0%, 100%, 0%, 0.4)"> </td>
<td style="background: rgba(0%, 100%, 0%, 0.2)"> </td>
<td style="background: rgba(0%, 100%, 0%, 0.0)"> </td>
<td style="background: black"> </td>
</tr>
</table>
</div>
<p>The following table should have four matching rows changing (in 5 steps) from blue at the left to black at the right: (plus a checkerboard at both ends to show where the rows are):</p>
<div style="background: black">
<table border="border">
<tr>
<td style="background: black"> </td>
<td style="background: rgba(0, 0, 255, 1.0)"> </td>
<td style="background: rgba(0, 0, 204, 1.0)"> </td>
<td style="background: rgba(0, 0, 153, 1.0)"> </td>
<td style="background: rgba(0, 0, 102, 1.0)"> </td>
<td style="background: rgba(0, 0, 51, 1.0)"> </td>
<td style="background: rgba(0, 0, 0, 1.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(0%, 0%, 100%, 1.0)"> </td>
<td style="background: rgba(0%, 0%, 80%, 1.0)"> </td>
<td style="background: rgba(0%, 0%, 60%, 1.0)"> </td>
<td style="background: rgba(0%, 0%, 40%, 1.0)"> </td>
<td style="background: rgba(0%, 0%, 20%, 1.0)"> </td>
<td style="background: rgba(0%, 0%, 0%, 1.0)"> </td>
<td style="background: black"> </td>
</tr>
<tr>
<td style="background: black"> </td>
<td style="background: rgba(0, 0, 255, 1.0)"> </td>
<td style="background: rgba(0, 0, 255, 0.8)"> </td>
<td style="background: rgba(0, 0, 255, 0.6)"> </td>
<td style="background: rgba(0, 0, 255, 0.4)"> </td>
<td style="background: rgba(0, 0, 255, 0.2)"> </td>
<td style="background: rgba(0, 0, 255, 0.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(0%, 0%, 100%, 1.0)"> </td>
<td style="background: rgba(0%, 0%, 100%, 0.8)"> </td>
<td style="background: rgba(0%, 0%, 100%, 0.6)"> </td>
<td style="background: rgba(0%, 0%, 100%, 0.4)"> </td>
<td style="background: rgba(0%, 0%, 100%, 0.2)"> </td>
<td style="background: rgba(0%, 0%, 100%, 0.0)"> </td>
<td style="background: black"> </td>
</tr>
</table>
</div>
<p>The following table should have four matching rows changing (in 5 steps) from blue at the left to white at the right: (plus a checkerboard at both ends to show where the rows are):</p>
<div style="background: white">
<table border="border">
<tr>
<td style="background: black"> </td>
<td style="background: rgba(0, 0, 255, 1.0)"> </td>
<td style="background: rgba(51, 51, 255, 1.0)"> </td>
<td style="background: rgba(102, 102, 255, 1.0)"> </td>
<td style="background: rgba(153, 153, 255, 1.0)"> </td>
<td style="background: rgba(204, 204, 255, 1.0)"> </td>
<td style="background: rgba(255, 255, 255, 1.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(0%, 0%, 100%, 1.0)"> </td>
<td style="background: rgba(20%, 20%, 100%, 1.0)"> </td>
<td style="background: rgba(40%, 40%, 100%, 1.0)"> </td>
<td style="background: rgba(60%, 60%, 100%, 1.0)"> </td>
<td style="background: rgba(80%, 80%, 100%, 1.0)"> </td>
<td style="background: rgba(100%, 100%, 100%, 1.0)"> </td>
<td style="background: black"> </td>
</tr>
<tr>
<td style="background: black"> </td>
<td style="background: rgba(0, 0, 255, 1.0)"> </td>
<td style="background: rgba(0, 0, 255, 0.8)"> </td>
<td style="background: rgba(0, 0, 255, 0.6)"> </td>
<td style="background: rgba(0, 0, 255, 0.4)"> </td>
<td style="background: rgba(0, 0, 255, 0.2)"> </td>
<td style="background: rgba(0, 0, 255, 0.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(0%, 0%, 100%, 1.0)"> </td>
<td style="background: rgba(0%, 0%, 100%, 0.8)"> </td>
<td style="background: rgba(0%, 0%, 100%, 0.6)"> </td>
<td style="background: rgba(0%, 0%, 100%, 0.4)"> </td>
<td style="background: rgba(0%, 0%, 100%, 0.2)"> </td>
<td style="background: rgba(0%, 0%, 100%, 0.0)"> </td>
<td style="background: black"> </td>
</tr>
</table>
</div>
<p>The following table should have four matching rows changing (in 5 steps) from red at the left to green at the right: (plus a checkerboard at both ends to show where the rows are):</p>
<div style="background: lime">
<table border="border">
<tr>
<td style="background: black"> </td>
<td style="background: rgba(255, 0, 0, 1.0)"> </td>
<td style="background: rgba(204, 51, 0, 1.0)"> </td>
<td style="background: rgba(153, 102, 0, 1.0)"> </td>
<td style="background: rgba(102, 153, 0, 1.0)"> </td>
<td style="background: rgba(51, 204, 0, 1.0)"> </td>
<td style="background: rgba(0, 255, 0, 1.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(100%, 0%, 0%, 1.0)"> </td>
<td style="background: rgba(80%, 20%, 0%, 1.0)"> </td>
<td style="background: rgba(60%, 40%, 0%, 1.0)"> </td>
<td style="background: rgba(40%, 60%, 0%, 1.0)"> </td>
<td style="background: rgba(20%, 80%, 0%, 1.0)"> </td>
<td style="background: rgba(0%, 100%, 0%, 1.0)"> </td>
<td style="background: black"> </td>
</tr>
<tr>
<td style="background: black"> </td>
<td style="background: rgba(255, 0, 0, 1.0)"> </td>
<td style="background: rgba(255, 0, 0, 0.8)"> </td>
<td style="background: rgba(255, 0, 0, 0.6)"> </td>
<td style="background: rgba(255, 0, 0, 0.4)"> </td>
<td style="background: rgba(255, 0, 0, 0.2)"> </td>
<td style="background: rgba(255, 0, 0, 0.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(100%, 0%, 0%, 1.0)"> </td>
<td style="background: rgba(100%, 0%, 0%, 0.8)"> </td>
<td style="background: rgba(100%, 0%, 0%, 0.6)"> </td>
<td style="background: rgba(100%, 0%, 0%, 0.4)"> </td>
<td style="background: rgba(100%, 0%, 0%, 0.2)"> </td>
<td style="background: rgba(100%, 0%, 0%, 0.0)"> </td>
<td style="background: black"> </td>
</tr>
</table>
</div>
<p>The following table should have four matching rows changing (in 5 steps) from green at the left to blue at the right: (plus a checkerboard at both ends to show where the rows are):</p>
<div style="background: blue">
<table border="border">
<tr>
<td style="background: black"> </td>
<td style="background: rgba(0, 255, 0, 1.0)"> </td>
<td style="background: rgba(0, 204, 51, 1.0)"> </td>
<td style="background: rgba(0, 153, 102, 1.0)"> </td>
<td style="background: rgba(0, 102, 153, 1.0)"> </td>
<td style="background: rgba(0, 51, 204, 1.0)"> </td>
<td style="background: rgba(0, 0, 255, 1.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(0%, 100%, 0%, 1.0)"> </td>
<td style="background: rgba(0%, 80%, 20%, 1.0)"> </td>
<td style="background: rgba(0%, 60%, 40%, 1.0)"> </td>
<td style="background: rgba(0%, 40%, 60%, 1.0)"> </td>
<td style="background: rgba(0%, 20%, 80%, 1.0)"> </td>
<td style="background: rgba(0%, 0%, 100%, 1.0)"> </td>
<td style="background: black"> </td>
</tr>
<tr>
<td style="background: black"> </td>
<td style="background: rgba(0, 255, 0, 1.0)"> </td>
<td style="background: rgba(0, 255, 0, 0.8)"> </td>
<td style="background: rgba(0, 255, 0, 0.6)"> </td>
<td style="background: rgba(0, 255, 0, 0.4)"> </td>
<td style="background: rgba(0, 255, 0, 0.2)"> </td>
<td style="background: rgba(0, 255, 0, 0.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(0%, 100%, 0%, 1.0)"> </td>
<td style="background: rgba(0%, 100%, 0%, 0.8)"> </td>
<td style="background: rgba(0%, 100%, 0%, 0.6)"> </td>
<td style="background: rgba(0%, 100%, 0%, 0.4)"> </td>
<td style="background: rgba(0%, 100%, 0%, 0.2)"> </td>
<td style="background: rgba(0%, 100%, 0%, 0.0)"> </td>
<td style="background: black"> </td>
</tr>
</table>
</div>
<p>The following table should have four matching rows changing (in 5 steps) from blue at the left to red at the right (plus a checkerboard at both ends to show where the rows are):</p>
<div style="background: red">
<table border="border">
<tr>
<td style="background: black"> </td>
<td style="background: rgba(0, 0, 255, 1.0)"> </td>
<td style="background: rgba(51, 0, 204, 1.0)"> </td>
<td style="background: rgba(102, 0, 153, 1.0)"> </td>
<td style="background: rgba(153, 0, 102, 1.0)"> </td>
<td style="background: rgba(204, 0, 51, 1.0)"> </td>
<td style="background: rgba(255, 0, 0, 1.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(0%, 0%, 100%, 1.0)"> </td>
<td style="background: rgba(20%, 0%, 80%, 1.0)"> </td>
<td style="background: rgba(40%, 0%, 60%, 1.0)"> </td>
<td style="background: rgba(60%, 0%, 40%, 1.0)"> </td>
<td style="background: rgba(80%, 0%, 20%, 1.0)"> </td>
<td style="background: rgba(100%, 0%, 0%, 1.0)"> </td>
<td style="background: black"> </td>
</tr>
<tr>
<td style="background: black"> </td>
<td style="background: rgba(0, 0, 255, 1.0)"> </td>
<td style="background: rgba(0, 0, 255, 0.8)"> </td>
<td style="background: rgba(0, 0, 255, 0.6)"> </td>
<td style="background: rgba(0, 0, 255, 0.4)"> </td>
<td style="background: rgba(0, 0, 255, 0.2)"> </td>
<td style="background: rgba(0, 0, 255, 0.0)"> </td>
<td style="background: white"> </td>
</tr>
<tr>
<td style="background: white"> </td>
<td style="background: rgba(0%, 0%, 100%, 1.0)"> </td>
<td style="background: rgba(0%, 0%, 100%, 0.8)"> </td>
<td style="background: rgba(0%, 0%, 100%, 0.6)"> </td>
<td style="background: rgba(0%, 0%, 100%, 0.4)"> </td>
<td style="background: rgba(0%, 0%, 100%, 0.2)"> </td>
<td style="background: rgba(0%, 0%, 100%, 0.0)"> </td>
<td style="background: black"> </td>
</tr>
</table>
</div>
</body>
</html>