{ "html": "\n\n \n \n HOWCOLORS.WORK<\/title>\n <link href=\"style.css\" rel=\"stylesheet\" \/>\n <\/head>\n <body class=\"markua\">\n <img\n alt=\"\"\n class=\"fullscreen\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/title_page.png\"\n \/>\n <div class=\"pagewithoutheader\">\n <h2 class=\"toc\">Table of Contents<\/h2>\n <ul class=\"toc no-parts\">\n <li><a href=\"#intro\">Intro<\/a><a href=\"#intro\"><\/a><\/li>\n <li>\n <a href=\"#current-ways-to-express-colors\">Current Ways to Express Colors!<\/a><a href=\"#current-ways-to-express-colors\"><\/a>\n <ul>\n <li><a href=\"#code-samples\">Code Samples<\/a><a href=\"#code-samples\"><\/a><\/li>\n <li><a href=\"#hex\">Hex<\/a><a href=\"#hex\"><\/a><\/li>\n <li><a href=\"#rgb\">RGB<\/a><a href=\"#rgb\"><\/a><\/li>\n <li><a href=\"#hsl\">HSL<\/a><a href=\"#hsl\"><\/a><\/li>\n <li><a href=\"#keywords\">Keywords<\/a><a href=\"#keywords\"><\/a><\/li>\n <\/ul>\n <\/li>\n <li>\n <a href=\"#new-ways-to-express-colors\">New Ways to Express Colors!<\/a><a href=\"#new-ways-to-express-colors\"><\/a>\n <ul>\n <li><a href=\"#code-samples-update\">Code Samples Update<\/a><a href=\"#code-samples-update\"><\/a><\/li>\n <li><a href=\"#hwb\">HWB<\/a><a href=\"#hwb\"><\/a><\/li>\n <li><a href=\"#lab\">Lab<\/a><a href=\"#lab\"><\/a><\/li>\n <li><a href=\"#lch\">LCH<\/a><a href=\"#lch\"><\/a><\/li>\n <li><a href=\"#color\">Color<\/a><a href=\"#color\"><\/a><\/li>\n <li><a href=\"#gray\">Gray<\/a><a href=\"#gray\"><\/a><\/li>\n <\/ul>\n <\/li>\n <li>\n <a href=\"#cool-ways-to-use-colors\">Cool Ways to Use Colors!<\/a><a href=\"#cool-ways-to-use-colors\"><\/a>\n <ul>\n <li><a href=\"#text-gradient\">Text Gradient<\/a><a href=\"#text-gradient\"><\/a><\/li>\n <li><a href=\"#box-shadows-as-borders\">Box Shadows as Borders<\/a><a href=\"#box-shadows-as-borders\"><\/a><\/li>\n <\/ul>\n <\/li>\n <li><a href=\"#answers\">Answers to Exercises<\/a><a href=\"#answers\"><\/a><\/li>\n <\/ul>\n <\/div>\n <h1 id=\"intro\">Intro<\/h1>\n <p>\n This booklet helps you understand the current and future color notations<span class=\"note\"> (Color notations are different ways to write down colors in your CSS code.)<\/span> in CSS.\n <\/p>\n <p>The aim is to teach you all different color notations available in CSS. Tell you whether the browsers support these notations already and show you some code examples.<\/p>\n <p>\n The color spaces<span class=\"note\"> (Color spaces are organizations of colors. A color space may define color swatches, like Pantone. Or have a more mathematical notation like sRGB or CMYK.)<\/span>, which CSS uses in these different ways to express colors are not part of this booklet. In some places I mention them but do not explain any color\n space in detail.\n <\/p>\n <p>To make full use of this booklet, all you need to know is how to create an HTML tag and apply CSS to it. All the different color options you will learn here!<\/p>\n <p>\n Most of the CSS colors are in the sRGB<span class=\"note\"> (sRGB (standard RED GREEN BLUE) is an RGB color space created to for the use on monitors and the web.)<\/span> color space, except Lab and LCH, where the computed value is a CIELab\n <span class=\"note\"> (The CIELAB color space defined by the International Commission on Illumination (CIE).)<\/span> color. Not to forget the new <code>color()<\/code> function. This makes it possible to pass your own or predefined color profiles!\n <\/p>\n <p>\n All these color notations offer an optional parameter for the alpha value. The alpha value indicates how transparent the color is. In the booklet, there is an extra section in each chapter that shows how to use the alpha values.\n <\/p>\n <aside class=\"information blurb\">\n <p>\n Before you use colors in your HTML documents, please consider the <a href=\"https:\/\/www.w3.org\/TR\/WCAG20\/\">W3C Web Content Accessibility Guidelines<\/a>. Most important is the contrast between your foreground and background\n color. For the current color notations, you can check the contrast with my <a href=\"https:\/\/convertingcolors.com\/color-contrast-checker.html\">Color Contrast Checker<\/a>.\n <\/p>\n <\/aside>\n <img\n alt=\"\"\n class=\"fullscreen\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/howcolors_work_book_current_section.png\"\n style=\"width: 100%;\"\n \/>\n <h1 id=\"current-ways-to-express-colors\">Current Ways to Express Colors!<\/h1>\n <h2 id=\"code-samples\">Code Samples<\/h2>\n <p>All the examples in this booklet use the same HTML structure. To make the examples look nice, I added a simple CSS grid and some basic formatting. The colors I define as CSS variables on the top.<\/p>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\"> 1 <\/code><code class=\"cp\"><!DOCTYPE html><\/code>\n<code class=\"lineno\"> 2 <\/code><code class=\"p\"><<\/code><code class=\"nt\">html<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 3 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">head<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 4 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">style<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 5 <\/code> <code class=\"p\">:<\/code><code class=\"nd\">root<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 6 <\/code> <code class=\"err\">--<\/code><code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"mh\">#128458<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 7 <\/code> <code class=\"err\">--<\/code><code class=\"n\">color-alpha<\/code><code class=\"p\">:<\/code><code class=\"mh\">#128458<\/code><code class=\"mi\">77<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 8 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\"> 9 <\/code>\n<code class=\"lineno\"> 10 <\/code> <code class=\"nt\">body<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 11 <\/code> <code class=\"k\">font-size<\/code><code class=\"p\">:<\/code><code class=\"mi\">20<\/code><code class=\"kt\">pt<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 12 <\/code> <code class=\"k\">font-family<\/code><code class=\"p\">:<\/code><code class=\"kc\">monospace<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 13 <\/code> <code class=\"k\">margin<\/code><code class=\"p\">:<\/code><code class=\"mi\">1<\/code><code class=\"kt\">rem<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 14 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\"> 15 <\/code>\n<code class=\"lineno\"> 16 <\/code> <code class=\"nt\">h2<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 17 <\/code> <code class=\"k\">margin<\/code><code class=\"p\">:<\/code><code class=\"mi\">0<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 18 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\"> 19 <\/code>\n<code class=\"lineno\"> 20 <\/code> <code class=\"nt\">h3<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 21 <\/code> <code class=\"k\">margin<\/code><code class=\"p\">:<\/code><code class=\"mi\">0<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 22 <\/code> <code class=\"k\">margin-top<\/code><code class=\"p\">:<\/code><code class=\"mi\">2<\/code><code class=\"kt\">rem<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 23 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\"> 24 <\/code>\n<code class=\"lineno\"> 25 <\/code> <code class=\"nt\">p<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 26 <\/code> <code class=\"k\">padding<\/code><code class=\"p\">:<\/code><code class=\"mi\">2<\/code><code class=\"kt\">rem<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 27 <\/code> <code class=\"k\">font-weight<\/code><code class=\"p\">:<\/code><code class=\"kc\">bold<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 28 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\"> 29 <\/code>\n<code class=\"lineno\"> 30 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">grid<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 31 <\/code> <code class=\"k\">display<\/code><code class=\"p\">:<\/code> <code class=\"k\">grid<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 32 <\/code> <code class=\"k\">grid-template-columns<\/code><code class=\"p\">:<\/code> <code class=\"nf\">repeat<\/code><code class=\"p\">(<\/code><code class=\"kc\">auto<\/code><code class=\"o\">-<\/code><code class=\"kc\">fill<\/code><code class=\"p\">,<\/code><code class=\"nf\">minmax<\/code><code class=\"p\">(<\/code><code class=\"mi\">640<\/code><code class=\"kt\">px<\/code><code class=\"p\">,<\/code><code class=\"mi\">1<\/code><code class=\"n\">fr<\/code><code class=\"p\">));<\/code>\n<code class=\"lineno\"> 33 <\/code> <code class=\"k\">grid-gap<\/code><code class=\"p\">:<\/code><code class=\"mi\">2<\/code><code class=\"kt\">rem<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 34 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\"> 35 <\/code>\n<code class=\"lineno\"> 36 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">grid<\/code> <code class=\"nt\">div<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 37 <\/code> <code class=\"k\">border<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"kc\">solid<\/code> <code class=\"mh\">#128458<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 38 <\/code> <code class=\"k\">padding<\/code><code class=\"p\">:<\/code><code class=\"mi\">2<\/code><code class=\"kt\">rem<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 39 <\/code> <code class=\"k\">padding-top<\/code><code class=\"p\">:<\/code><code class=\"mi\">1<\/code><code class=\"kt\">rem<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 40 <\/code> <code class=\"k\">padding-bottom<\/code><code class=\"p\">:<\/code><code class=\"mi\">1<\/code><code class=\"kt\">rem<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 41 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\"> 42 <\/code>\n<code class=\"lineno\"> 43 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">textsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 44 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\"> 45 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\"> 46 <\/code>\n<code class=\"lineno\"> 47 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">textsample_alpha<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 48 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"o\">-<\/code><code class=\"kc\">alpha<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\"> 49 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\"> 50 <\/code>\n<code class=\"lineno\"> 51 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">bgsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 52 <\/code> <code class=\"k\">background-color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\"> 53 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\"> 54 <\/code>\n<code class=\"lineno\"> 55 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">bgsample_alpha<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 56 <\/code> <code class=\"k\">background-color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"o\">-<\/code><code class=\"kc\">alpha<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\"> 57 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\"> 58 <\/code>\n<code class=\"lineno\"> 59 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">bordersample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 60 <\/code> <code class=\"k\">border<\/code><code class=\"p\">:<\/code><code class=\"mi\">8<\/code><code class=\"kt\">px<\/code> <code class=\"kc\">solid<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\"> 61 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\"> 62 <\/code>\n<code class=\"lineno\"> 63 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">bordersample_alpha<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 64 <\/code> <code class=\"k\">border<\/code><code class=\"p\">:<\/code><code class=\"mi\">8<\/code><code class=\"kt\">px<\/code> <code class=\"kc\">solid<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"o\">-<\/code><code class=\"kc\">alpha<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\"> 65 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\"> 66 <\/code>\n<code class=\"lineno\"> 67 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">shadowsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 68 <\/code> <code class=\"k\">text-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\"> 69 <\/code> <code class=\"k\">box-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\"> 70 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\"> 71 <\/code>\n<code class=\"lineno\"> 72 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">shadowsample_alpha<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 73 <\/code> <code class=\"k\">text-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"o\">-<\/code><code class=\"kc\">alpha<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\"> 74 <\/code> <code class=\"k\">box-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"o\">-<\/code><code class=\"kc\">alpha<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\"> 75 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\"> 76 <\/code> <code class=\"p\"><\/<\/code><code class=\"nt\">style<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 77 <\/code> <code class=\"p\"><\/<\/code><code class=\"nt\">head<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 78 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">body<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 79 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">div<\/code> <code class=\"na\">class<\/code><code class=\"o\">=<\/code><code class=\"s\">\"grid\"<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 80 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">div<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 81 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">h2<\/code><code class=\"p\">><\/code>Text<code class=\"p\"><\/<\/code><code class=\"nt\">h2<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 82 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">p<\/code> <code class=\"na\">class<\/code><code class=\"o\">=<\/code><code class=\"s\">\"textsample\"<\/code><code class=\"p\">><\/code>HOWCOLORS.WORK<code class=\"p\"><\/<\/code><code class=\"nt\">p<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 83 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">h3<\/code><code class=\"p\">><\/code>Alpha<code class=\"p\"><\/<\/code><code class=\"nt\">h3<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 84 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">p<\/code> <code class=\"na\">class<\/code><code class=\"o\">=<\/code><code class=\"s\">\"textsample_alpha\"<\/code><code class=\"p\">><\/code>HOWCOLORS.WORK<code class=\"p\"><\/<\/code><code class=\"nt\">p<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 85 <\/code> <code class=\"p\"><\/<\/code><code class=\"nt\">div<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 86 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">div<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 87 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">h2<\/code><code class=\"p\">><\/code>Background<code class=\"p\"><\/<\/code><code class=\"nt\">h2<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 88 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">p<\/code> <code class=\"na\">class<\/code><code class=\"o\">=<\/code><code class=\"s\">\"bgsample\"<\/code><code class=\"p\">><\/code>HOWCOLORS.WORK<code class=\"p\"><\/<\/code><code class=\"nt\">p<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 89 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">h3<\/code><code class=\"p\">><\/code>Alpha<code class=\"p\"><\/<\/code><code class=\"nt\">h3<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 90 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">p<\/code> <code class=\"na\">class<\/code><code class=\"o\">=<\/code><code class=\"s\">\"bgsample_alpha\"<\/code><code class=\"p\">><\/code>HOWCOLORS.WORK<code class=\"p\"><\/<\/code><code class=\"nt\">p<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 91 <\/code> <code class=\"p\"><\/<\/code><code class=\"nt\">div<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 92 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">div<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 93 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">h2<\/code><code class=\"p\">><\/code>Border<code class=\"p\"><\/<\/code><code class=\"nt\">h2<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 94 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">p<\/code> <code class=\"na\">class<\/code><code class=\"o\">=<\/code><code class=\"s\">\"bordersample\"<\/code><code class=\"p\">><\/code>HOWCOLORS.WORK<code class=\"p\"><\/<\/code><code class=\"nt\">p<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 95 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">h3<\/code><code class=\"p\">><\/code>Alpha<code class=\"p\"><\/<\/code><code class=\"nt\">h3<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 96 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">p<\/code> <code class=\"na\">class<\/code><code class=\"o\">=<\/code><code class=\"s\">\"bordersample_alpha\"<\/code><code class=\"p\">><\/code>HOWCOLORS.WORK<code class=\"p\"><\/<\/code><code class=\"nt\">p<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 97 <\/code> <code class=\"p\"><\/<\/code><code class=\"nt\">div<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 98 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">div<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 99 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">h2<\/code><code class=\"p\">><\/code>Shadow<code class=\"p\"><\/<\/code><code class=\"nt\">h2<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\">100 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">p<\/code> <code class=\"na\">class<\/code><code class=\"o\">=<\/code><code class=\"s\">\"shadowsample\"<\/code><code class=\"p\">><\/code>HOWCOLORS.WORK<code class=\"p\"><\/<\/code><code class=\"nt\">p<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\">101 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">h3<\/code><code class=\"p\">><\/code>Alpha<code class=\"p\"><\/<\/code><code class=\"nt\">h3<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\">102 <\/code> <code class=\"p\"><<\/code><code class=\"nt\">p<\/code> <code class=\"na\">class<\/code><code class=\"o\">=<\/code><code class=\"s\">\"shadowsample_alpha\"<\/code><code class=\"p\">><\/code>HOWCOLORS.WORK<code class=\"p\"><\/<\/code><code class=\"nt\">p<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\">103 <\/code> <code class=\"p\"><\/<\/code><code class=\"nt\">div<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\">104 <\/code> <code class=\"p\"><\/<\/code><code class=\"nt\">div<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\">105 <\/code> <code class=\"p\"><\/<\/code><code class=\"nt\">body<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\">106 <\/code><code class=\"p\"><\/<\/code><code class=\"nt\">html<\/code><code class=\"p\">><\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <p>The result of this code will give you four boxes for the text, background, border, and shadow CSS examples.<\/p>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_sample.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>The browser output of the above code<\/figcaption>\n <\/figure>\n <\/div>\n <p>\n In the following CSS examples, we will change the <code>--color<\/code> and <code>--color-alpha<\/code> variables. Instead of a variable as color <code>color:var(--color);<\/code> you could of course also pass the color value\n <code>color:#FF0000;<\/code>.\n <\/p>\n <h2 id=\"hex\">Hex<\/h2>\n <p>The hex color notation allows you to define sRGB colors as hexadecimal numbers. It starts with a hash <code>#<\/code>, and then you have the three primary colors, red, green and last the blue color.<\/p>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/PrimaryColors.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>The primary colors, red, green, and blue.<\/figcaption>\n <\/figure>\n <\/div>\n <p>\n The hex notation only allows ten numerals (0-9) and six letters (a-f). Where <code>00<\/code> would be <code>0<\/code> in the RGB functional notation, and <code>FF<\/code> would be <code>255<\/code>.<br \/>\n The higher the value of a primary color is, the brighter that color is. This means that the hex color <code>#000000<\/code> has zero brightness in all three primary colors and is black. The color <code>#FFFFFF<\/code> is the\n opposite as all colors have the full light, which leads to white.\n <\/p>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/FFCCCCFF9999FF6666FF3333FF0000CC0000990000660000330000.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>A example of brighter and darker versions of red <code>#FF0000<\/code><\/figcaption>\n <\/figure>\n <\/div>\n <aside class=\"tip blurb\">\n <p>\n If you use any RGB color format to express colors, you should consider writing them in this notation. This is true in case the file size is the most important to you and readability comes second. The hex notation gives you\n the shortest color strings. You can define some colors in the three-digit notation. That three-digit short-form reduces your color string (including <code>#<\/code>) to four or five characters.\n <\/p>\n <\/aside>\n <div class=\"keep-together\">\n <h3 id=\"syntax\">Syntax<\/h3>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_hex_long.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">#<\/td>\n <td style=\"text-align: center;\">44<\/td>\n <td style=\"text-align: center;\">2B<\/td>\n <td style=\"text-align: center;\">82<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1<\/dt>\n <dd>\n <p>The <code>#<\/code> indicates that the following is a hex color notation.<\/p>\n <\/dd>\n <dt>2<\/dt>\n <dd>The red part of the color, two hexadecimal characters (0\u20139, A\u2013F).<\/dd>\n <dt>3<\/dt>\n <dd>The green part of the color, two hexadecimal characters.<\/dd>\n <dt>4<\/dt>\n <dd>The blue part of the color, two hexadecimal characters.<\/dd>\n <\/dl>\n <\/div>\n <div class=\"keep-together\">\n <h4 id=\"alpha\">Alpha<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_hex_long_alpha.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">#<\/td>\n <td style=\"text-align: center;\">44<\/td>\n <td style=\"text-align: center;\">2B<\/td>\n <td style=\"text-align: center;\">82<\/td>\n <td style=\"text-align: center;\">77<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1 till 4<\/dt>\n <dd>These parts are the same as for the color notation without an alpha value. To get details have a look at the section above.<\/dd>\n <dt>5<\/dt>\n <dd>\n <p>The opacity part of the color, two hexadecimal characters. Where <code>FF<\/code> = 100%, <code>CC<\/code> = 80%, <code>99<\/code> = 60%, <code>66<\/code> = 40%, <code>33<\/code> = 20%, and <code>00<\/code> = 0%.<\/p>\n <\/dd>\n <\/dl>\n <\/div>\n <div class=\"keep-together\">\n <h4 id=\"code-samples-1\">Code Samples<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_hex_long.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>Result with the color values #442B82 and #442B8277<\/figcaption>\n <\/figure>\n <\/div>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\">1 <\/code><code class=\"p\">:<\/code><code class=\"nd\">root<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">2 <\/code> <code class=\"err\">--<\/code><code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"mh\">#442B82<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">3 <\/code> <code class=\"err\">--<\/code><code class=\"n\">color-alpha<\/code><code class=\"p\">:<\/code><code class=\"mh\">#442B82<\/code><code class=\"mi\">77<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">4 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <\/div>\n <h3 id=\"three-digit-notation\">Three-digit notation<\/h3>\n <p>\n It is possible to use a three-digit or four-digit (including the alpha value) notation. In this short-form the single digits get doubled. So, for example, <code>#0FC<\/code> would be <code>#00FFCC<\/code> in the standard form. The\n downside is you only have 4096 colors available in the short-form.\n <\/p>\n <div class=\"keep-together\">\n <h4 id=\"three-digit-syntax\">Three-digit Syntax<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_hex_short.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">#<\/td>\n <td style=\"text-align: center;\">8<\/td>\n <td style=\"text-align: center;\">4<\/td>\n <td style=\"text-align: center;\">0<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1<\/dt>\n <dd>\n <p>The <code>#<\/code> indicates that the following is a hex color notation.<\/p>\n <\/dd>\n <dt>2<\/dt>\n <dd>The red part of the color, one hexadecimal character (0\u20139, A\u2013F).<\/dd>\n <dt>3<\/dt>\n <dd>The green part of the color, one hexadecimal character.<\/dd>\n <dt>4<\/dt>\n <dd>The blue part of the color, one hexadecimal character.<\/dd>\n <\/dl>\n <\/div>\n <div class=\"keep-together\">\n <h4 id=\"alpha-1\">Alpha<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_hex_short_alpha.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">#<\/td>\n <td style=\"text-align: center;\">8<\/td>\n <td style=\"text-align: center;\">4<\/td>\n <td style=\"text-align: center;\">0<\/td>\n <td style=\"text-align: center;\">7<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1 till 4<\/dt>\n <dd>These parts are the same as for the color notation without an alpha value. To get details have a look at the section above.<\/dd>\n <dt>5<\/dt>\n <dd>\n <p>The opacity part of the color, one hexadecimal character. Where <code>F<\/code> = 100%, <code>C<\/code> = 80%, <code>9<\/code> = 60%, <code>6<\/code> = 40%, <code>3<\/code> = 20%, and <code>0<\/code> = 0%.<\/p>\n <\/dd>\n <\/dl>\n <\/div>\n <div class=\"keep-together\">\n <h4 id=\"code-samples-2\">Code Samples<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_hex_short.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>Result with the color values #840 and #8407<\/figcaption>\n <\/figure>\n <\/div>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\">1 <\/code><code class=\"p\">:<\/code><code class=\"nd\">root<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">2 <\/code> <code class=\"err\">--<\/code><code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"mh\">#840<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">3 <\/code> <code class=\"err\">--<\/code><code class=\"n\">color-alpha<\/code><code class=\"p\">:<\/code><code class=\"mh\">#8407<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">4 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <\/div>\n <h3 id=\"browser-support\">Browser Support<\/h3>\n <p>\n The hex notation, is <a href=\"https:\/\/caniuse.com\/#feat=mdn-css_types_color_rgb_hexadecimal_notation\">supported in all browsers<\/a>. The four and eight-digit short-form has\n <a href=\"https:\/\/caniuse.com\/#feat=css-rrggbbaa\">support in all major browsers<\/a>.\n <\/p>\n <div id=\"hexexercise\" class=\"quiz\">\n <h3 id=\"exercise\">Exercise<\/h3>\n <ol class=\"quiz-questions\">\n <li>\n <p>How many characters can a hex color have (without <code>#<\/code>)?<\/p>\n <ol class=\"quiz-choices\" type=\"a\">\n <li>4<\/li>\n <li>5<\/li>\n <li>2<\/li>\n <\/ol>\n <\/li>\n <li>\n <p>The hexadecimal alpha value <code>66<\/code> in percent?<\/p>\n <\/li>\n <li>\n <p>How many colors are available in the three-digit notation?<\/p>\n <ol class=\"quiz-choices\" type=\"a\">\n <li>Same as in the long format<\/li>\n <li>16.777.216<\/li>\n <li>4096<\/li>\n <\/ol>\n <\/li>\n <\/ol>\n <\/div>\n <h2 id=\"rgb\">RGB<\/h2>\n <p>\n The RGB functions build the colors from a combination of red, green, and blue. Each of these color values defines the intensity of the color as an integer value. The values range from <code>0<\/code> to <code>255<\/code> or from\n <code>0%<\/code> to <code>100%<\/code> percent. If you pass <code>0<\/code> to all three values you will get black, if you pass <code>255<\/code> to all you get white.\n <\/p>\n <p>The computed value of the following functions is a color in the sRGB color space.<\/p>\n <aside class=\"tip blurb\">\n <p>The functional RGB notation is longer than the hex, but it is easier to read as we have integer values.<\/p>\n <\/aside>\n <h3 id=\"the-primary-colors\">The Primary Colors<\/h3>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/PrimaryColors.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>The primary colors, red, green, and blue.<\/figcaption>\n <\/figure>\n <\/div>\n <div class=\"keep-together\">\n <h4 id=\"red\">Red<\/h4>\n <table style=\"width: 100%;\">\n <thead>\n <tr>\n <th style=\"text-align: center;\">Red<\/th>\n <th style=\"text-align: center;\">Green<\/th>\n <th style=\"text-align: center;\">Blue<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\"><code>255<\/code><\/td>\n <td style=\"text-align: center;\"><code>0<\/code><\/td>\n <td style=\"text-align: center;\"><code>0<\/code><\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <p>If you only set the red value to the highest possible value <code>255<\/code>, it gives you the brightest red, which is possible.<\/p>\n <h4 id=\"green\">Green<\/h4>\n <table style=\"width: 100%;\">\n <thead>\n <tr>\n <th style=\"text-align: center;\">Red<\/th>\n <th style=\"text-align: center;\">Green<\/th>\n <th style=\"text-align: center;\">Blue<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\"><code>0%<\/code><\/td>\n <td style=\"text-align: center;\"><code>100%<\/code><\/td>\n <td style=\"text-align: center;\"><code>0%<\/code><\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <p>Here only the green value is set to <code>100%<\/code>, which gives you the brightest green possible.<\/p>\n <h4 id=\"blue\">Blue<\/h4>\n <table style=\"width: 100%;\">\n <thead>\n <tr>\n <th style=\"text-align: center;\">Red<\/th>\n <th style=\"text-align: center;\">Green<\/th>\n <th style=\"text-align: center;\">Blue<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\"><code>0<\/code><\/td>\n <td style=\"text-align: center;\"><code>0<\/code><\/td>\n <td style=\"text-align: center;\"><code>255<\/code><\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <p>The same logic applies for blue, so by setting the value to <code>255<\/code> and the other two values to <code>0<\/code>, you get the brightest blue.<\/p> \n <\/div>\n <div class=\"keep-together\">\n <h3 id=\"old-syntax\">Old Syntax<\/h3>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_old_rgb.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <th style=\"text-align: center;\">9<\/th>\n <th style=\"text-align: center;\">10<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">rgb<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">15<\/td>\n <td style=\"text-align: center;\">,<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">64<\/td>\n <td style=\"text-align: center;\">,<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">174<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1<\/dt>\n <dd>\n <p>The function starts with an <code>rgb<\/code>.<\/p>\n <\/dd>\n <dt>2<\/dt>\n <dd>Following the function name, an opening bracket.<\/dd>\n <dt>3<\/dt>\n <dd>\n <p>The red value of the color can be a number or a percentage. The numbers are in the range of <code>0<\/code> - <code>255<\/code>, where <code>255<\/code> equals <code>100%<\/code>.<\/p>\n <\/dd>\n <dt>4<\/dt>\n <dd>A comma as the separator between the color values.<\/dd>\n <dt>5<\/dt>\n <dd>An optional space.<\/dd>\n <dt>6<\/dt>\n <dd>The green value of the color. Allowed are the same values as for red.<\/dd>\n <dt>7<\/dt>\n <dd>A comma as the separator between the color values.<\/dd>\n <dt>8<\/dt>\n <dd>An optional space.<\/dd>\n <dt>9<\/dt>\n <dd>The blue value of the color. Allowed are the same values as for red and green.<\/dd>\n <dt>10<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <div class=\"keep-together\">\n <h4 id=\"alpha-2\">Alpha<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_old_rgb_alpha.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <th style=\"text-align: center;\">9<\/th>\n <th style=\"text-align: center;\">10<\/th>\n <th style=\"text-align: center;\">11<\/th>\n <th style=\"text-align: center;\">12<\/th>\n <th style=\"text-align: center;\">13<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">rgba<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">15<\/td>\n <td style=\"text-align: center;\">,<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">64<\/td>\n <td style=\"text-align: center;\">,<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">174<\/td>\n <td style=\"text-align: center;\">,<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">80%<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1<\/dt>\n <dd>\n <p>If you want to add the colors alpha value, the old syntax\u2019s function needs to start with a <code>rgba<\/code>.<\/p>\n <\/dd>\n <dt>2 till 9<\/dt>\n <dd>These parts are the same as for the color notation without an alpha value. To get details have a look at the section above.<\/dd>\n <dt>10<\/dt>\n <dd>A comma as the separator between the color values and the alpha value.<\/dd>\n <dt>11<\/dt>\n <dd>An optional space.<\/dd>\n <dt>12<\/dt>\n <dd>\n <p>\n You can define the alpha (opacity) value as a number between <code>0<\/code> and <code>1<\/code> or as a percentage. For example, <code>1<\/code> or <code>100%<\/code> means full opacity, while <code>0.5<\/code> or\n <code>50%<\/code> is means half opacity.\n <\/p>\n <\/dd>\n <dt>13<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <h4 id=\"browser-support-1\">Browser Support<\/h4>\n <p>All major <a href=\"https:\/\/caniuse.com\/#feat=mdn-css_types_color_rgb_functional_notation\">browsers support<\/a> the RGB functional notation.<\/p>\n <div class=\"keep-together\">\n <h4 id=\"code-samples-3\">Code Samples<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_rgb.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>Result with the color values rgb(15, 64, 174) and rgba(15, 64, 174, 80%)<\/figcaption>\n <\/figure>\n <\/div>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\">1 <\/code><code class=\"p\">:<\/code><code class=\"nd\">root<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">2 <\/code> <code class=\"err\">--<\/code><code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nb\">rgb<\/code><code class=\"p\">(<\/code><code class=\"mi\">15<\/code><code class=\"p\">,<\/code> <code class=\"mi\">64<\/code><code class=\"p\">,<\/code> <code class=\"mi\">174<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">3 <\/code> <code class=\"err\">--<\/code><code class=\"n\">color-alpha<\/code><code class=\"p\">:<\/code><code class=\"nb\">rgba<\/code><code class=\"p\">(<\/code><code class=\"mi\">15<\/code><code class=\"p\">,<\/code> <code class=\"mi\">64<\/code><code class=\"p\">,<\/code> <code class=\"mi\">174<\/code><code class=\"p\">,<\/code> <code class=\"mi\">80<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">4 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <\/div>\n <div class=\"keep-together\">\n <h3 id=\"new-syntax\">New Syntax<\/h3>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_new_rgb.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">rgb<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">47<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">27<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">41<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1<\/dt>\n <dd>\n <p>Same as the old syntax, the new one starts an <code>rgb<\/code>.<\/p>\n <\/dd>\n <dt>2<\/dt>\n <dd>\n <p>An opening bracket follows the <code>rgb<\/code>.<\/p>\n <\/dd>\n <dt>3<\/dt>\n <dd>\n <p>The red value of the color can be a number or a percentage. The numbers are in the range of <code>0<\/code> - <code>255<\/code>, where <code>255<\/code> equals <code>100%<\/code>.<\/p>\n <\/dd>\n <dt>4<\/dt>\n <dd>Space as the separator between the color values.<\/dd>\n <dt>5<\/dt>\n <dd>The green value of the color. Allowed are the same values as for the red (3) part.<\/dd>\n <dt>6<\/dt>\n <dd>Space as the separator between the color values.<\/dd>\n <dt>7<\/dt>\n <dd>The blue value of the color also can be a number or a percentage.<\/dd>\n <dt>8<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <div class=\"keep-together\">\n <h4 id=\"alpha-3\">Alpha<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_new_rgb_alpha.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <th style=\"text-align: center;\">9<\/th>\n <th style=\"text-align: center;\">10<\/th>\n <th style=\"text-align: center;\">11<\/th>\n <th style=\"text-align: center;\">12<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">rgb<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">47<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">27<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">41<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">\/<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">0.6<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1<\/dt>\n <dd>\n <p>In the new syntax, the functional notation, including the alpha value, also starts with <code>rgb<\/code>.<\/p>\n <\/dd>\n <dt>2 till 7<\/dt>\n <dd>These parts are the same as for the color notation without an alpha value. To get details have a look at the section above.<\/dd>\n <dt>8<\/dt>\n <dd>Space as the separator between the color values and the alpha value.<\/dd>\n <dt>9<\/dt>\n <dd>\n <p>A <code>\/<\/code> as the separator between the color values and the alpha value.<\/p>\n <\/dd>\n <dt>10<\/dt>\n <dd>Space.<\/dd>\n <dt>11<\/dt>\n <dd>\n <p>\n You can define the alpha (opacity) value as a number between <code>0<\/code> and <code>1<\/code> or as a percentage. For example, <code>1<\/code> or <code>100%<\/code> means full opacity, while <code>0.5<\/code> or\n <code>50%<\/code> means half opacity.\n <\/p>\n <\/dd>\n <dt>12<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <h4 id=\"browser-support-2\">Browser Support<\/h4>\n <p>\n The browser support for the space-separated functional color notations is excellent. All major browsers support it already. For details check\n <a href=\"https:\/\/caniuse.com\/#feat=mdn-css_types_color_space_separated_functional_notation\">caniuse.com<\/a>.\n <\/p>\n <div class=\"keep-together\">\n <h4 id=\"code-samples-4\">Code Samples<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_rgb_new.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>Result with the color values rgb(47 27 41) and rgb(47 27 41 \/ 0.6)<\/figcaption>\n <\/figure>\n <\/div>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\">1 <\/code><code class=\"p\">:<\/code><code class=\"nd\">root<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">2 <\/code> <code class=\"err\">--<\/code><code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nb\">rgb<\/code><code class=\"p\">(<\/code><code class=\"mi\">47<\/code> <code class=\"mi\">27<\/code> <code class=\"mi\">41<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">3 <\/code> <code class=\"err\">--<\/code><code class=\"n\">color-alpha<\/code><code class=\"p\">:<\/code><code class=\"nb\">rgb<\/code><code class=\"p\">(<\/code><code class=\"mi\">47<\/code> <code class=\"mi\">27<\/code> <code class=\"mi\">41<\/code> <code class=\"o\">\/<\/code> <code class=\"mf\">0.6<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">4 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <\/div>\n <div id=\"rgbexercise\" class=\"quiz\">\n <h3 id=\"exercise-1\">Exercise<\/h3>\n <ol class=\"quiz-questions\">\n <li>\n <p>Which notation is invalid?<\/p>\n <ol class=\"quiz-choices\" type=\"a\">\n <li>rgb(55 10 0)<\/li>\n <li>rgba(200, 73, 12, .75)<\/li>\n <li>rgb(255 100 100, 100%)<\/li>\n <li>rgb(100% 10% 0%)<\/li>\n <\/ol>\n <\/li>\n <li>\n <p>The <code>G<\/code> in RGB stands for?<\/p>\n <\/li>\n <li>\n <p>You can pass a percentage from 0 - 100%, but what is the range for integer values?<\/p>\n <ol class=\"quiz-choices\" type=\"a\">\n <li>0 - 255<\/li>\n <li>0 - 100<\/li>\n <li>0 - 360<\/li>\n <\/ol>\n <\/li>\n <\/ol>\n <\/div>\n <h2 id=\"hsl\">HSL<\/h2>\n <p>The hexadecimal and functional RGB notations are quite tricky to read and alter. The HSL functional notation is easier to read and work with. It makes it easy to, for example, get a darker version of the same hue.<\/p>\n <p>The hue is an angle on the color wheel, where red equals <code>0<\/code> and <code>360<\/code> degree. Green equals <code>120<\/code> degree and blue <code>240<\/code> degree.<\/p>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/HSLColorWheel.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>Color Wheel<\/figcaption>\n <\/figure>\n <\/div>\n <aside class=\"tip blurb\">\n <p>Changing the hue makes it easy to get complementing colors. All you need to do is add 180 degrees to get the complementary color.<\/p>\n <\/aside>\n <div class=\"keep-together\">\n <h3 id=\"old-syntax-1\">Old Syntax<\/h3>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_old_hsl.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <th style=\"text-align: center;\">9<\/th>\n <th style=\"text-align: center;\">10<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">hsl<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">3<\/td>\n <td style=\"text-align: center;\">,<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">76%<\/td>\n <td style=\"text-align: center;\">,<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">27%<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1<\/dt>\n <dd>\n <p>The function starts with an <code>hsl<\/code>.<\/p>\n <\/dd>\n <dt>2<\/dt>\n <dd>An opening bracket follows the function name.<\/dd>\n <dt>3<\/dt>\n <dd>This part defines the hue, which is an angle on the color circle. You define it as a unitless number, which CSS takes as degrees.<\/dd>\n <dt>4<\/dt>\n <dd>A comma as the separator between the color values.<\/dd>\n <dt>5<\/dt>\n <dd>An optional space.<\/dd>\n <dt>6<\/dt>\n <dd>\n <p>The saturation of your color as a percentage. <code>100%<\/code> means completely saturated, and <code>0%<\/code> is completely unsaturated so gray.<\/p>\n <\/dd>\n <dt>7<\/dt>\n <dd>A comma as the separator between the color values.<\/dd>\n <dt>8<\/dt>\n <dd>An optional space.<\/dd>\n <dt>9<\/dt>\n <dd>\n <p>The lightness of your HSL color, where <code>100%<\/code> is white, and <code>0%<\/code> lightness is black.<\/p>\n <\/dd>\n <dt>10<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <div class=\"keep-together\">\n <h4 id=\"alpha-4\">Alpha<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_old_hsl_alpha.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <th style=\"text-align: center;\">9<\/th>\n <th style=\"text-align: center;\">10<\/th>\n <th style=\"text-align: center;\">11<\/th>\n <th style=\"text-align: center;\">12<\/th>\n <th style=\"text-align: center;\">13<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">hsla<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">3<\/td>\n <td style=\"text-align: center;\">,<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">76%<\/td>\n <td style=\"text-align: center;\">,<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">27%<\/td>\n <td style=\"text-align: center;\">,<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">50%<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1<\/dt>\n <dd>\n <p>The function starts with an <code>hsla<\/code>.<\/p>\n <\/dd>\n <dt>2 till 9<\/dt>\n <dd>These parts are the same as for the color notation without an alpha value. To get details have a look at the section above.<\/dd>\n <dt>10<\/dt>\n <dd>A comma as the separator between the color values and the alpha value.<\/dd>\n <dt>11<\/dt>\n <dd>An optional space.<\/dd>\n <dt>12<\/dt>\n <dd>\n <p>\n You can define the alpha (opacity) value as a number between <code>0<\/code> and <code>1<\/code> or as a percentage. For example, <code>1<\/code> or <code>100%<\/code> means full opacity, while <code>0.5<\/code> or\n <code>50%<\/code> means half opacity.\n <\/p>\n <\/dd>\n <dt>13<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <h4 id=\"browser-support-3\">Browser Support<\/h4>\n <p>\n The HSL notation is <a href=\"https:\/\/caniuse.com\/#feat=mdn-css_types_color_hsl\">supported in all browsers<\/a>. The alpha color values in the old HSLA syntax are also supported. Details you can find on\n <a href=\"https:\/\/caniuse.com\/#feat=mdn-css_types_color_alpha\">caniuse.com<\/a>.\n <\/p>\n <div class=\"keep-together\">\n <h4 id=\"code-samples-5\">Code Samples<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_hsl.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>Result with the color values hsl(3, 76%, 27%) and hsla(3, 76%, 27%, 50%)<\/figcaption>\n <\/figure>\n <\/div>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\">1 <\/code><code class=\"p\">:<\/code><code class=\"nd\">root<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">2 <\/code> <code class=\"err\">--<\/code><code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nb\">hsl<\/code><code class=\"p\">(<\/code><code class=\"mi\">3<\/code><code class=\"p\">,<\/code> <code class=\"mi\">76<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code> <code class=\"mi\">27<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">3 <\/code> <code class=\"err\">--<\/code><code class=\"n\">color-alpha<\/code><code class=\"p\">:<\/code><code class=\"nb\">hsla<\/code><code class=\"p\">(<\/code><code class=\"mi\">3<\/code><code class=\"p\">,<\/code> <code class=\"mi\">76<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code> <code class=\"mi\">27<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">4 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <\/div>\n <div class=\"keep-together\">\n <h3 id=\"new-syntax-1\">New Syntax<\/h3>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_new_hsl.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">hsl<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">295<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">85%<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">28%<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1<\/dt>\n <dd>\n <p>The function starts with an <code>hsl<\/code>.<\/p>\n <\/dd>\n <dt>2<\/dt>\n <dd>An opening bracket follows the function name.<\/dd>\n <dt>3<\/dt>\n <dd>\n This part defines the hue, which is an angle on the color circle. You define it as a unitless number, which CSS takes as degrees.<br \/>\n <p>\n Red = <code>0<\/code> and <code>360<\/code> degree.<br \/>\n Green = <code>120<\/code> degree.<br \/>\n Blue = <code>240<\/code> degree.\n <\/p>\n <p>In the new CSS Color Module Level 4, you could define the angle as degrees, rads, grads, or turns. For example, <code>1turn<\/code>.<\/p>\n <\/dd>\n <dt>4<\/dt>\n <dd>Space as the separator between the color values.<\/dd>\n <dt>5<\/dt>\n <dd>\n <p>The saturation of your color as a percentage. <code>100%<\/code> is completely saturated, and <code>0%<\/code> is completely unsaturated so gray.<\/p>\n <\/dd>\n <dt>6<\/dt>\n <dd>Space as the separator between the color values.<\/dd>\n <dt>7<\/dt>\n <dd>\n <p>The lightness of your HSL color, where <code>100%<\/code> is white, and <code>0%<\/code> lightness is black.<\/p>\n <\/dd>\n <dt>8<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <div class=\"keep-together\">\n <h4 id=\"alpha-5\">Alpha<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_new_hsl_alpha.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <th style=\"text-align: center;\">9<\/th>\n <th style=\"text-align: center;\">10<\/th>\n <th style=\"text-align: center;\">11<\/th>\n <th style=\"text-align: center;\">12<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">hsl<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">295<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">85%<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">28%<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">\/<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">.75<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1<\/dt>\n <dd>\n <p>The function starts with an <code>hsl<\/code>.<\/p>\n <\/dd>\n <dt>2 till 7<\/dt>\n <dd>These parts are the same as for the color notation without an alpha value. To get details have a look at the section above.<\/dd>\n <dt>8<\/dt>\n <dd>Space as the separator between the color values and the alpha value.<\/dd>\n <dt>9<\/dt>\n <dd>\n <p>A <code>\/<\/code> as the separator between the color values and the alpha value.<\/p>\n <\/dd>\n <dt>10<\/dt>\n <dd>Space.<\/dd>\n <dt>11<\/dt>\n <dd>\n <p>\n You can define the alpha (opacity) value as a number between <code>0<\/code> and <code>1<\/code> or as a percentage. For example, <code>1<\/code> or <code>100%<\/code> means full opacity, while <code>0.5<\/code> or\n <code>50%<\/code> means half opacity.\n <\/p>\n <\/dd>\n <dt>12<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <h4 id=\"browser-support-4\">Browser Support<\/h4>\n <p>\n The browser support for the space-separated functional color notations is excellent. All major browsers support it already. For details check\n <a href=\"https:\/\/caniuse.com\/#feat=mdn-css_types_color_space_separated_functional_notation\">caniuse.com<\/a>.\n <\/p>\n <div class=\"keep-together\">\n <h4 id=\"code-samples-6\">Code Samples<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_hsl_new.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>Result with the color values hsl(295 85% 28%) and hsl(295 85% 28% \/ .75)<\/figcaption>\n <\/figure>\n <\/div>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\">1 <\/code><code class=\"p\">:<\/code><code class=\"nd\">root<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">2 <\/code> <code class=\"err\">--<\/code><code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nb\">hsl<\/code><code class=\"p\">(<\/code><code class=\"mi\">295<\/code> <code class=\"mi\">85<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">28<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">3 <\/code> <code class=\"err\">--<\/code><code class=\"n\">color-alpha<\/code><code class=\"p\">:<\/code><code class=\"nb\">hsl<\/code><code class=\"p\">(<\/code><code class=\"mi\">295<\/code> <code class=\"mi\">85<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">28<\/code><code class=\"kt\">%<\/code> <code class=\"o\">\/<\/code> <code class=\"mf\">.75<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">4 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <\/div>\n <div id=\"hslexercise\" class=\"quiz\">\n <h3 id=\"exercise-2\">Exercise<\/h3>\n <ol class=\"quiz-questions\">\n <li>\n <p>Which notation is invalid?<\/p>\n <ol class=\"quiz-choices\" type=\"a\">\n <li>hsl(75deg 10% 70%)<\/li>\n <li>hsl(300 100 50)<\/li>\n <li>hsl(300 100% 50%)<\/li>\n <\/ol>\n <\/li>\n <li>\n <p>The <code>L<\/code> in HSL stands for?<\/p>\n <\/li>\n <li>\n <p>At which degree on the color wheel do you find blue?<\/p>\n <ol class=\"quiz-choices\" type=\"a\">\n <li>20 degree<\/li>\n <li>120 degree<\/li>\n <li>240 degree<\/li>\n <\/ol>\n <\/li>\n <\/ol>\n <\/div>\n <div class=\"keep-together\">\n <h2 id=\"keywords\">Keywords<\/h2>\n <p>The current chapter would not be complete without a mention of the color keywords. You can use these keywords besides the already covered notations.<\/p>\n <h3 id=\"transparent\">Transparent<\/h3>\n <p>The <code>transparent<\/code> keyword gets computed to a transparent black, like <code>#000000<\/code> or <code>rgb(0, 0, 0, 0)<\/code>.<\/p>\n <h4 id=\"browser-support-5\">Browser Support<\/h4>\n <p>All browsers support the <code>transparent<\/code> keyword. For details have a look at <a href=\"https:\/\/caniuse.com\/#feat=mdn-css_types_color_transparent\">caniuse.com<\/a>.<\/p>\n <h4 id=\"code-sample\">Code Sample<\/h4>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\">1 <\/code><code class=\"nt\">div<\/code> <code class=\"p\">{<\/code> \n<code class=\"lineno\">2 <\/code> <code class=\"k\">background-color<\/code><code class=\"p\">:<\/code><code class=\"kc\">transparent<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">3 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"kc\">transparent<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">4 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <\/div>\n <div class=\"keep-together\">\n <h3 id=\"current-color\">Current Color<\/h3>\n <p>\n If you use the <code>currentcolor<\/code> keyword you get the value of the CSS <code>color:<\/code> property on the current element. For example, set the color of your element to yellow. Now use the\n <code>currentcolor<\/code> keyword as the background color. The browser output for this background color would also be yellow.\n <\/p>\n <h4 id=\"browser-support-6\">Browser Support<\/h4>\n <p>This keyword is also <a href=\"https:\/\/caniuse.com\/#feat=currentcolor\">supported in all browsers<\/a>.<\/p>\n <h4 id=\"code-sample-1\">Code Sample<\/h4>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\">1 <\/code><code class=\"nt\">div<\/code> <code class=\"p\">{<\/code> \n<code class=\"lineno\">2 <\/code> <code class=\"k\">background-color<\/code><code class=\"p\">:<\/code><code class=\"n\">currentcolor<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">3 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"kc\">yellow<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">4 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <\/div>\n <div class=\"keep-together\">\n <h3 id=\"named-colors\">Named Colors<\/h3>\n <p>\n CSS has taken over some named colors from HTML and extended the list of named colors a lot. You can find a list of all named colors in the <a href=\"https:\/\/www.w3.org\/TR\/css-color-4\/#named-colors\">CSS Color Module<\/a>. All these\n color names resolve to a color in the sRGB color space.\n <\/p>\n <aside class=\"tip blurb\">\n <p>If you look for the smallest CSS file possible. It is worth having a look at the named colors. Some names are even shorter than their hexadecimal notation.<\/p>\n <\/aside>\n <h4 id=\"browser-support-7\">Browser Support<\/h4>\n <p>Color names are <a href=\"https:\/\/caniuse.com\/#feat=mdn-css_types_color_keyword_color_values\">supported in all browsers<\/a>.<\/p>\n <h4 id=\"code-sample-2\">Code Sample<\/h4>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\">1 <\/code><code class=\"nt\">div<\/code> <code class=\"p\">{<\/code> \n<code class=\"lineno\">2 <\/code> <code class=\"k\">background-color<\/code><code class=\"p\">:<\/code><code class=\"kc\">gold<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">3 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"kc\">gold<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">4 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <\/div>\n <img\n alt=\"\"\n class=\"fullscreen\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/howcolors_work_book_new_section.png\"\n style=\"width: 100%;\"\n \/>\n <h1 id=\"new-ways-to-express-colors\">New Ways to Express Colors!<\/h1>\n <p>Have a look at the <a href=\"https:\/\/www.w3.org\/TR\/css-color-4\/\">CSS Color Module Level 4 working draft<\/a>. You can see a lot of new ways to express colors in CSS.<\/p>\n <p>All these new notations only support the space-separated functional notation. So commas as separators are not allowed.<\/p>\n <aside class=\"information blurb\">\n <p>Unfortunately, no browser supports these notations yet. But you should prepare yourself for the future and learn them now!<\/p>\n <\/aside>\n <h2 id=\"code-samples-update\">Code Samples Update<\/h2>\n <p>As these new formats are not supported yet, you should make a small change to the CSS. You can use the color variables as fallback colors and define the color in the new syntax in the selector.<\/p>\n <p>Unfortunately, you can not use a second CSS variable here. I tested this, and the invalid color notation is not detected when it comes from a variable.<\/p>\n <p>Still, in this way, you can already start defining colors with the new notations!<\/p>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\"> 1 <\/code><code class=\"p\"><<\/code><code class=\"nt\">style<\/code><code class=\"p\">><\/code>\n<code class=\"lineno\"> 2 <\/code> <code class=\"p\">:<\/code><code class=\"nd\">root<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 3 <\/code> <code class=\"c\">\/* Use these as fallbacks now *\/<\/code>\n<code class=\"lineno\"> 4 <\/code> <code class=\"err\">--<\/code><code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"mh\">#808080<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 5 <\/code> <code class=\"err\">--<\/code><code class=\"n\">color-alpha<\/code><code class=\"p\">:<\/code><code class=\"mh\">#808080<\/code><code class=\"n\">FF<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 6 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\"> 7 <\/code>\n<code class=\"lineno\"> 8 <\/code> <code class=\"nt\">body<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 9 <\/code> <code class=\"k\">font-size<\/code><code class=\"p\">:<\/code><code class=\"mi\">20<\/code><code class=\"kt\">pt<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">10 <\/code> <code class=\"k\">font-family<\/code><code class=\"p\">:<\/code><code class=\"kc\">monospace<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">11 <\/code> <code class=\"k\">margin<\/code><code class=\"p\">:<\/code><code class=\"mi\">1<\/code><code class=\"kt\">rem<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">12 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\">13 <\/code>\n<code class=\"lineno\">14 <\/code> <code class=\"nt\">h2<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">15 <\/code> <code class=\"k\">margin<\/code><code class=\"p\">:<\/code><code class=\"mi\">0<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">16 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\">17 <\/code>\n<code class=\"lineno\">18 <\/code> <code class=\"nt\">h3<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">19 <\/code> <code class=\"k\">margin<\/code><code class=\"p\">:<\/code><code class=\"mi\">0<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">20 <\/code> <code class=\"k\">margin-top<\/code><code class=\"p\">:<\/code><code class=\"mi\">2<\/code><code class=\"kt\">rem<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">21 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\">22 <\/code>\n<code class=\"lineno\">23 <\/code> <code class=\"nt\">p<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">24 <\/code> <code class=\"k\">padding<\/code><code class=\"p\">:<\/code><code class=\"mi\">2<\/code><code class=\"kt\">rem<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">25 <\/code> <code class=\"k\">font-weight<\/code><code class=\"p\">:<\/code><code class=\"kc\">bold<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">26 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\">27 <\/code>\n<code class=\"lineno\">28 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">grid<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">29 <\/code> <code class=\"k\">display<\/code><code class=\"p\">:<\/code> <code class=\"k\">grid<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">30 <\/code> <code class=\"k\">grid-template-columns<\/code><code class=\"p\">:<\/code> <code class=\"nf\">repeat<\/code><code class=\"p\">(<\/code><code class=\"kc\">auto<\/code><code class=\"o\">-<\/code><code class=\"kc\">fill<\/code><code class=\"p\">,<\/code><code class=\"nf\">minmax<\/code><code class=\"p\">(<\/code><code class=\"mi\">640<\/code><code class=\"kt\">px<\/code><code class=\"p\">,<\/code><code class=\"mi\">1<\/code><code class=\"n\">fr<\/code><code class=\"p\">));<\/code>\n<code class=\"lineno\">31 <\/code> <code class=\"k\">grid-gap<\/code><code class=\"p\">:<\/code><code class=\"mi\">2<\/code><code class=\"kt\">rem<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">32 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\">33 <\/code>\n<code class=\"lineno\">34 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">grid<\/code> <code class=\"nt\">div<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">35 <\/code> <code class=\"k\">border<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"kc\">solid<\/code> <code class=\"mh\">#128458<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">36 <\/code> <code class=\"k\">padding<\/code><code class=\"p\">:<\/code><code class=\"mi\">2<\/code><code class=\"kt\">rem<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">37 <\/code> <code class=\"k\">padding-top<\/code><code class=\"p\">:<\/code><code class=\"mi\">1<\/code><code class=\"kt\">rem<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">38 <\/code> <code class=\"k\">padding-bottom<\/code><code class=\"p\">:<\/code><code class=\"mi\">1<\/code><code class=\"kt\">rem<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">39 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\">40 <\/code>\n<code class=\"lineno\">41 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">textsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">42 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">43 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nb\">hwb<\/code><code class=\"p\">(<\/code><code class=\"mi\">300<\/code><code class=\"kt\">deg<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">44 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\">45 <\/code>\n<code class=\"lineno\">46 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">textsample_alpha<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">47 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"o\">-<\/code><code class=\"kc\">alpha<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">48 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nb\">hwb<\/code><code class=\"p\">(<\/code><code class=\"mi\">300<\/code><code class=\"kt\">deg<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code> <code class=\"o\">\/<\/code> <code class=\"mi\">100<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">49 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\">50 <\/code>\n<code class=\"lineno\">51 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">bgsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">52 <\/code> <code class=\"k\">background-color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">53 <\/code> <code class=\"k\">background-color<\/code><code class=\"p\">:<\/code><code class=\"nb\">hwb<\/code><code class=\"p\">(<\/code><code class=\"mi\">300<\/code><code class=\"kt\">deg<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">54 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\">55 <\/code>\n<code class=\"lineno\">56 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">bgsample_alpha<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">57 <\/code> <code class=\"k\">background-color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"o\">-<\/code><code class=\"kc\">alpha<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">58 <\/code> <code class=\"k\">background-color<\/code><code class=\"p\">:<\/code><code class=\"nb\">hwb<\/code><code class=\"p\">(<\/code><code class=\"mi\">300<\/code><code class=\"kt\">deg<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code> <code class=\"o\">\/<\/code> <code class=\"mi\">100<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">59 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\">60 <\/code>\n<code class=\"lineno\">61 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">bordersample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">62 <\/code> <code class=\"k\">border<\/code><code class=\"p\">:<\/code><code class=\"mi\">8<\/code><code class=\"kt\">px<\/code> <code class=\"kc\">solid<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">63 <\/code> <code class=\"k\">border<\/code><code class=\"p\">:<\/code><code class=\"mi\">8<\/code><code class=\"kt\">px<\/code> <code class=\"kc\">solid<\/code> <code class=\"nb\">hwb<\/code><code class=\"p\">(<\/code><code class=\"mi\">300<\/code><code class=\"kt\">deg<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">64 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\">65 <\/code>\n<code class=\"lineno\">66 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">bordersample_alpha<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">67 <\/code> <code class=\"k\">border<\/code><code class=\"p\">:<\/code><code class=\"mi\">8<\/code><code class=\"kt\">px<\/code> <code class=\"kc\">solid<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"o\">-<\/code><code class=\"kc\">alpha<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">68 <\/code> <code class=\"k\">border<\/code><code class=\"p\">:<\/code><code class=\"mi\">8<\/code><code class=\"kt\">px<\/code> <code class=\"kc\">solid<\/code> <code class=\"nb\">hwb<\/code><code class=\"p\">(<\/code><code class=\"mi\">300<\/code><code class=\"kt\">deg<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code> <code class=\"o\">\/<\/code> <code class=\"mi\">100<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">69 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\">70 <\/code>\n<code class=\"lineno\">71 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">shadowsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">72 <\/code> <code class=\"k\">text-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">73 <\/code> <code class=\"k\">text-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nb\">hwb<\/code><code class=\"p\">(<\/code><code class=\"mi\">300<\/code><code class=\"kt\">deg<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">74 <\/code> <code class=\"k\">box-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">75 <\/code> <code class=\"k\">box-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nb\">hwb<\/code><code class=\"p\">(<\/code><code class=\"mi\">300<\/code><code class=\"kt\">deg<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">76 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\">77 <\/code>\n<code class=\"lineno\">78 <\/code> <code class=\"p\">.<\/code><code class=\"nc\">shadowsample_alpha<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">79 <\/code> <code class=\"k\">text-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"o\">-<\/code><code class=\"kc\">alpha<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">80 <\/code> <code class=\"k\">text-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nb\">hwb<\/code><code class=\"p\">(<\/code><code class=\"mi\">300<\/code><code class=\"kt\">deg<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code> <code class=\"o\">\/<\/code> <code class=\"mi\">100<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">81 <\/code> <code class=\"k\">box-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"o\">-<\/code><code class=\"kc\">alpha<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">82 <\/code> <code class=\"k\">box-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nb\">hwb<\/code><code class=\"p\">(<\/code><code class=\"mi\">300<\/code><code class=\"kt\">deg<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code> <code class=\"o\">\/<\/code> <code class=\"mi\">100<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">83 <\/code> <code class=\"p\">}<\/code>\n<code class=\"lineno\">84 <\/code><code class=\"p\"><\/<\/code><code class=\"nt\">style<\/code><code class=\"p\">><\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <p>This will give you the same result as the initial code sample. But in your developer tools, you can see a difference. The browser first tries to understand the new color syntax and after that goes to the fallback.<\/p>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/dev_console.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>Developer Tools \u2013 Invalid property value<\/figcaption>\n <\/figure>\n <\/div>\n <p>In the CSS examples below, you will only see the text color example. You can check other cases, like the background, here as the color notation works the same.<\/p>\n <h2 id=\"hwb\">HWB<\/h2>\n <p>HWB is another functional notation to define colors, similar to HSL. The hue is an angle of <code>0<\/code> - <code>360<\/code> degrees, and values of <code>0%<\/code> - <code>100%<\/code> for the whiteness and blackness.<\/p>\n <p>This new notation is even easier to understand then the HSL notation. That\u2019s the reason why many color pickers, offer the possibility to select colors based on HWB.<\/p>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 268px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/gimp_hwb_color_picker.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>GIMP Color Picker<\/figcaption>\n <\/figure>\n <\/div>\n <div class=\"keep-together\">\n <h3 id=\"syntax-1\">Syntax<\/h3>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_hwb.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">hwb<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">193deg<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">4%<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">54%<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1<\/dt>\n <dd>\n <p>The function starts with an <code>hwb<\/code>.<\/p>\n <\/dd>\n <dt>2<\/dt>\n <dd>An opening bracket follows the function name.<\/dd>\n <dt>3<\/dt>\n <dd>\n This part defines the hue, which is an angle on the color circle.<br \/>\n <p>\n Red = <code>0<\/code> and <code>360<\/code> degree.<br \/>\n Green = <code>120<\/code> degree.<br \/>\n Blue = <code>240<\/code> degree.\n <\/p>\n <\/dd>\n <dt>4<\/dt>\n <dd>Space as the separator between the color values.<\/dd>\n <dt>5<\/dt>\n <dd>\n <p>The whiteness of your color as a percentage. <code>100%<\/code> is full whiteness, and <code>0%<\/code> is no whiteness at all.<\/p>\n <\/dd>\n <dt>6<\/dt>\n <dd>Space as the separator between the color values.<\/dd>\n <dt>7<\/dt>\n <dd>\n <p>The blackness of your HWB color, where <code>100%<\/code> is full blackness, and <code>0%<\/code> no blackness at all.<\/p>\n <\/dd>\n <dt>8<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <div class=\"keep-together\">\n <h4 id=\"alpha-6\">Alpha<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_hwb_alpha.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <th style=\"text-align: center;\">9<\/th>\n <th style=\"text-align: center;\">10<\/th>\n <th style=\"text-align: center;\">11<\/th>\n <th style=\"text-align: center;\">12<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">hwb<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">193deg<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">4%<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">54%<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">\/<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">90%<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1 till 7<\/dt>\n <dd>These parts are the same as for the color notation without an alpha value. To get details have a look at the section above.<\/dd>\n <dt>8<\/dt>\n <dd>Space as the separator between the color values and the alpha value.<\/dd>\n <dt>9<\/dt>\n <dd>\n <p>A <code>\/<\/code> as the separator between the color values and the alpha value.<\/p>\n <\/dd>\n <dt>10<\/dt>\n <dd>Space.<\/dd>\n <dt>11<\/dt>\n <dd>\n <p>\n You can define the alpha (opacity) value as a number between <code>0<\/code> and <code>1<\/code> or as a percentage. For example, <code>1<\/code> or <code>100%<\/code> means full opacity, while <code>0.5<\/code> or\n <code>50%<\/code> means half opacity.\n <\/p>\n <\/dd>\n <dt>12<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <h3 id=\"browser-support-8\">Browser Support<\/h3>\n <p>No browser supports this way of expressing colors yet.<\/p>\n <div class=\"keep-together\">\n <h3 id=\"code-samples-7\">Code Samples<\/h3>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_hwb.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>Result using the fallback color values #0A5E75 and #0A5E75E6<\/figcaption>\n <\/figure>\n <\/div>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\"> 1 <\/code><code class=\"p\">:<\/code><code class=\"nd\">root<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 2 <\/code> <code class=\"c\">\/* Use these as fallbacks now *\/<\/code>\n<code class=\"lineno\"> 3 <\/code> <code class=\"err\">--<\/code><code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"mh\">#0A5E75<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 4 <\/code> <code class=\"err\">--<\/code><code class=\"n\">color-alpha<\/code><code class=\"p\">:<\/code><code class=\"mh\">#0A5E75<\/code><code class=\"n\">E6<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 5 <\/code><code class=\"p\">}<\/code>\n<code class=\"lineno\"> 6 <\/code>\n<code class=\"lineno\"> 7 <\/code><code class=\"p\">.<\/code><code class=\"nc\">textsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 8 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\"> 9 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nb\">hwb<\/code><code class=\"p\">(<\/code><code class=\"mi\">193<\/code><code class=\"kt\">deg<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">54<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">10 <\/code><code class=\"p\">}<\/code>\n<code class=\"lineno\">11 <\/code>\n<code class=\"lineno\">12 <\/code><code class=\"p\">.<\/code><code class=\"nc\">textsample_alpha<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">13 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"o\">-<\/code><code class=\"kc\">alpha<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">14 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nb\">hwb<\/code><code class=\"p\">(<\/code><code class=\"mi\">193<\/code><code class=\"kt\">deg<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">54<\/code><code class=\"kt\">%<\/code> <code class=\"o\">\/<\/code> <code class=\"mi\">90<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">15 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <\/div>\n <div id=\"hwbexercise\" class=\"quiz\">\n <h3 id=\"exercise-3\">Exercise<\/h3>\n <ol class=\"quiz-questions\">\n <li>\n <p>Which notation is invalid?<\/p>\n <ol class=\"quiz-choices\" type=\"a\">\n <li>hwb(75deg 30% 70%)<\/li>\n <li>hwb(300 25% 75% \/ 0.5)<\/li>\n <li>hwb(300deg, 50, 50)<\/li>\n <\/ol>\n <\/li>\n <li>\n <p>The <code>H<\/code> in HWB stands for?<\/p>\n <\/li>\n <li>\n <p>At which degree on the color wheel do you find green?<\/p>\n <ol class=\"quiz-choices\" type=\"a\">\n <li>20 degree<\/li>\n <li>120 degree<\/li>\n <li>240 degree<\/li>\n <\/ol>\n <\/li>\n <\/ol>\n <\/div>\n <h2 id=\"lab\">Lab<\/h2>\n <p>The CIELab color space represents the complete range of colors a human can see. Once major browsers support this notation it means way more colors for you!<\/p>\n <p>\n For the second and third function parameter we move along the a and b axes of the color space. There are positive and negative values allowed. Positive values along the a-axis give you a red while negative values are green. On\n the b-axis, positive values are yellow and negative values are blue.\n <\/p>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/lab_a_b_axis.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>A visual of the CIELab a and b axes.<\/figcaption>\n <\/figure>\n <\/div>\n <div class=\"keep-together\">\n <h3 id=\"syntax-2\">Syntax<\/h3>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_lab.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">lab<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">36%<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">54<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">-6<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1<\/dt>\n <dd>\n <p>The function starts with a <code>lab<\/code>.<\/p>\n <\/dd>\n <dt>2<\/dt>\n <dd>An opening bracket follows the function name.<\/dd>\n <dt>3<\/dt>\n <dd>\n <p>The first value is the CIE lightness; usually, it is between <code>0%<\/code> (black) and <code>100%<\/code> (white). Still, it can exceed that range for extra bright whites up to <code>400%<\/code>.<\/p>\n <\/dd>\n <dt>4<\/dt>\n <dd>Space as the separator between the color values.<\/dd>\n <dt>5<\/dt>\n <dd>The second parameter is the distance along the a-axises in the Lab colorspace.<\/dd>\n <dt>6<\/dt>\n <dd>Space as the separator between the color values.<\/dd>\n <dt>7<\/dt>\n <dd>The third parameter is the distance along the b-axises in the Lab colorspace.<\/dd>\n <dt>8<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <div class=\"keep-together\">\n <h4 id=\"alpha-7\">Alpha<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_lab_alpha.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <th style=\"text-align: center;\">9<\/th>\n <th style=\"text-align: center;\">10<\/th>\n <th style=\"text-align: center;\">11<\/th>\n <th style=\"text-align: center;\">12<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">lab<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">36%<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">54<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">-6<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">\/<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">0.4<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1 till 7<\/dt>\n <dd>These parts are the same as for the color notation without an alpha value. To get details have a look at the section above.<\/dd>\n <dt>8<\/dt>\n <dd>Space as the separator between the color values and the alpha value.<\/dd>\n <dt>9<\/dt>\n <dd>\n <p>A <code>\/<\/code> as the separator between the color values and the alpha value.<\/p>\n <\/dd>\n <dt>10<\/dt>\n <dd>Space.<\/dd>\n <dt>11<\/dt>\n <dd>\n <p>\n You can define the alpha (opacity) value as a number between <code>0<\/code> and <code>1<\/code> or as a percentage. For example, <code>1<\/code> or <code>100%<\/code> means full opacity, while <code>0.5<\/code> or\n <code>50%<\/code> means half opacity.\n <\/p>\n <\/dd>\n <dt>12<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <h3 id=\"browser-support-9\">Browser Support<\/h3>\n <p>No browser supports this way of expressing colors yet.<\/p>\n <div class=\"keep-together\">\n <h3 id=\"code-samples-8\">Code Samples<\/h3>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_lab.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>Result using the fallback color values #9C2160 and #9C216066<\/figcaption>\n <\/figure>\n <\/div>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\"> 1 <\/code><code class=\"p\">:<\/code><code class=\"nd\">root<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 2 <\/code> <code class=\"c\">\/* Use these as fallbacks now *\/<\/code>\n<code class=\"lineno\"> 3 <\/code> <code class=\"err\">--<\/code><code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"mh\">#9C2160<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 4 <\/code> <code class=\"err\">--<\/code><code class=\"n\">color-alpha<\/code><code class=\"p\">:<\/code><code class=\"mh\">#9C2160<\/code><code class=\"mi\">66<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 5 <\/code><code class=\"p\">}<\/code>\n<code class=\"lineno\"> 6 <\/code>\n<code class=\"lineno\"> 7 <\/code><code class=\"p\">.<\/code><code class=\"nc\">textsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 8 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\"> 9 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">lab<\/code><code class=\"p\">(<\/code><code class=\"mi\">36<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">54<\/code> <code class=\"mi\">-6<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">10 <\/code><code class=\"p\">}<\/code>\n<code class=\"lineno\">11 <\/code>\n<code class=\"lineno\">12 <\/code><code class=\"p\">.<\/code><code class=\"nc\">textsample_alpha<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">13 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"o\">-<\/code><code class=\"kc\">alpha<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">14 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">lab<\/code><code class=\"p\">(<\/code><code class=\"mi\">36<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">54<\/code> <code class=\"mi\">-6<\/code> <code class=\"o\">\/<\/code> <code class=\"mf\">0.4<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">15 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <\/div>\n <div id=\"labexercise\" class=\"quiz\">\n <h3 id=\"exercise-4\">Exercise<\/h3>\n <ol class=\"quiz-questions\">\n <li>\n <p>Which notation is invalid?<\/p>\n <ol class=\"quiz-choices\" type=\"a\">\n <li>lab(100%, 100, 160)<\/li>\n <li>lab(50% 50 -160)<\/li>\n <li>lab(350% 50 160)<\/li>\n <\/ol>\n <\/li>\n <li>\n <p>The <code>a<\/code> in Lab stands for?<\/p>\n <\/li>\n <li>\n <p>What range does the first parameter allow?<\/p>\n <ol class=\"quiz-choices\" type=\"a\">\n <li>0 - 400%<\/li>\n <li>0 - 100%<\/li>\n <li>0 - 360 degree<\/li>\n <\/ol>\n <\/li>\n <\/ol>\n <\/div>\n <h2 id=\"lch\">LCH<\/h2>\n <p>Another new way to express colors in the CSS 4 working draft is the <code>lch()<\/code> notation.<\/p>\n <div class=\"keep-together\">\n <h3 id=\"syntax-3\">Syntax<\/h3>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_lch.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">lch<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">12%<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">8<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">211<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1<\/dt>\n <dd>\n <p>The function starts with an <code>lch<\/code>.<\/p>\n <\/dd>\n <dt>2<\/dt>\n <dd>An opening bracket follows the function name.<\/dd>\n <dt>3<\/dt>\n <dd>\n <p>The first value is the lightness; usually, it is between <code>0%<\/code> (black) and <code>100%<\/code> (white). Still, it can exceed that range for extra bright whites up to <code>400%<\/code>.<\/p>\n <\/dd>\n <dt>4<\/dt>\n <dd>Space as the separator between the color values.<\/dd>\n <dt>5<\/dt>\n <dd>\n <p>\n The second value is the amount of color or chroma, usually between <code>0<\/code> and <code>230<\/code>. A value above <code>77<\/code> exceeds the boundaries of the sRGB color space which most of the CSS color notations\n use.\n <\/p>\n <\/dd>\n <dt>6<\/dt>\n <dd>Space as the separator between the color values.<\/dd>\n <dt>7<\/dt>\n <dd>This part defines the hue, which is an angle on the color circle (or wheel). See the HSL section for a visual of the color wheel.<\/dd>\n <dt>8<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <div class=\"keep-together\">\n <h4 id=\"alpha-8\">Alpha<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_lch_alpha.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <th style=\"text-align: center;\">9<\/th>\n <th style=\"text-align: center;\">10<\/th>\n <th style=\"text-align: center;\">11<\/th>\n <th style=\"text-align: center;\">12<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">lch<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">12%<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">8<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">211<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">\/<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">60%<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1 till 7<\/dt>\n <dd>These parts are the same as for the color notation without an alpha value. To get details have a look at the section above.<\/dd>\n <dt>8<\/dt>\n <dd>Space as the separator between the color values and the alpha value.<\/dd>\n <dt>9<\/dt>\n <dd>\n <p>A <code>\/<\/code> as the separator between the color values and the alpha value.<\/p>\n <\/dd>\n <dt>10<\/dt>\n <dd>Space.<\/dd>\n <dt>11<\/dt>\n <dd>\n <p>\n You can define the alpha (opacity) value as a number between <code>0<\/code> and <code>1<\/code> or as a percentage. For example, <code>1<\/code> or <code>100%<\/code> means full opacity, while <code>0.5<\/code> or\n <code>50%<\/code> means half opacity.\n <\/p>\n <\/dd>\n <dt>12<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <h3 id=\"browser-support-10\">Browser Support<\/h3>\n <p>No browser supports this way of expressing colors yet.<\/p>\n <div class=\"keep-together\">\n <h3 id=\"code-samples-9\">Code Samples<\/h3>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_lch.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>Result using the fallback color values #0F2225 and #0F222599<\/figcaption>\n <\/figure>\n <\/div>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\"> 1 <\/code><code class=\"p\">:<\/code><code class=\"nd\">root<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 2 <\/code> <code class=\"c\">\/* Use these as fallbacks now *\/<\/code>\n<code class=\"lineno\"> 3 <\/code> <code class=\"err\">--<\/code><code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"mh\">#0F2225<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 4 <\/code> <code class=\"err\">--<\/code><code class=\"n\">color-alpha<\/code><code class=\"p\">:<\/code><code class=\"mh\">#0F2225<\/code><code class=\"mi\">99<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 5 <\/code><code class=\"p\">}<\/code>\n<code class=\"lineno\"> 6 <\/code>\n<code class=\"lineno\"> 7 <\/code><code class=\"p\">.<\/code><code class=\"nc\">textsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 8 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\"> 9 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">lch<\/code><code class=\"p\">(<\/code><code class=\"mi\">12<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">8<\/code> <code class=\"mi\">211<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">10 <\/code><code class=\"p\">}<\/code>\n<code class=\"lineno\">11 <\/code>\n<code class=\"lineno\">12 <\/code><code class=\"p\">.<\/code><code class=\"nc\">textsample_alpha<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">13 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"o\">-<\/code><code class=\"kc\">alpha<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">14 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">lch<\/code><code class=\"p\">(<\/code><code class=\"mi\">12<\/code><code class=\"kt\">%<\/code> <code class=\"mi\">8<\/code> <code class=\"mi\">211<\/code> <code class=\"o\">\/<\/code> <code class=\"mi\">60<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">15 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <\/div>\n <div id=\"lchexercise\" class=\"quiz\">\n <h3 id=\"exercise-5\">Exercise<\/h3>\n <ol class=\"quiz-questions\">\n <li>\n <p>Which notation is invalid?<\/p>\n <ol class=\"quiz-choices\" type=\"a\">\n <li>lch(100% 100 160deg)<\/li>\n <li>lch(50% 50 60deg)<\/li>\n <li>lch(50% 50 380deg)<\/li>\n <\/ol>\n <\/li>\n <li>\n <p>The <code>h<\/code> in Lab stands for?<\/p>\n <\/li>\n <li>\n <p>What range of values can you use for the second parameter?<\/p>\n <ol class=\"quiz-choices\" type=\"a\">\n <li>0 - 100<\/li>\n <li>0 - 230<\/li>\n <li>0 - 360<\/li>\n <\/ol>\n <\/li>\n <\/ol>\n <\/div>\n <h2 id=\"color\">Color<\/h2>\n <p>\n With the notation <code>color()<\/code>, CSS will allow you to specify colors in reference to a color profile. You can pass the color profile as the first parameter. You can pass one of the predefined color profiles\n (<code>srgb<\/code>, <code>prophoto-rgb<\/code>, <code>display-p3<\/code>, <code>rec-2020<\/code>, <code>a98-rgb<\/code>) or you define an own profile.\n <\/p>\n <p>\n If you want to add your own profile, you need to specify it first with a <code>@color-profile<\/code> rule. Then you can use it within the <code>color()<\/code> function, this works almost like defining new fonts via\n <code>@font-face<\/code>.\n <\/p>\n <div class=\"keep-together\">\n <h3 id=\"syntax-4\">Syntax<\/h3>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_color.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <th style=\"text-align: center;\">9<\/th>\n <th style=\"text-align: center;\">10<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">color<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">display-p3<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">0.4087<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">0.1048<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">0<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1<\/dt>\n <dd>\n <p>The function starts with a <code>color<\/code>.<\/p>\n <\/dd>\n <dt>2<\/dt>\n <dd>An opening bracket follows the function name.<\/dd>\n <dt>3<\/dt>\n <dd>This is an optional parameter defining the color space. Either you choose one of the predefined ones or one you created yourself.<\/dd>\n <dt>4<\/dt>\n <dd>Space as the separator between the color values.<\/dd>\n <dt>5 till 9<\/dt>\n <dd>\n Depending on the colorspace, you either pass a string or a set of numeric parameters here. If you provide fewer color values than the colorspace requires, CSS will take <code>0<\/code> for the remaining. This repeats with\n space as separator till the last value for the color space. <br \/>\n <p>In our example, we pass 3 values between <code>0<\/code> and <code>1<\/code>, all separated by a space.<\/p>\n <\/dd>\n <dt>10<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <div class=\"keep-together\">\n <h4 id=\"alpha-9\">Alpha<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_color_alpha.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <th style=\"text-align: center;\">9<\/th>\n <th style=\"text-align: center;\">10<\/th>\n <th style=\"text-align: center;\">11<\/th>\n <th style=\"text-align: center;\">12<\/th>\n <th style=\"text-align: center;\">13<\/th>\n <th style=\"text-align: center;\">14<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">color<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">display-p3<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">0.4087<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">0.1048<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">0<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">\/<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">.8<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1 till 9<\/dt>\n <dd>These parts are the same as for the color notation without an alpha value. To get details have a look at the section above.<\/dd>\n <dt>10<\/dt>\n <dd>Space as the separator between the color values and the alpha value.<\/dd>\n <dt>11<\/dt>\n <dd>\n <p>A <code>\/<\/code> as the separator between the color values and the alpha value.<\/p>\n <\/dd>\n <dt>12<\/dt>\n <dd>Space.<\/dd>\n <dt>13<\/dt>\n <dd>\n <p>\n You can define the alpha (opacity) value as a number between <code>0<\/code> and <code>1<\/code> or as a percentage. For example, <code>1<\/code> or <code>100%<\/code> means full opacity, while <code>0.5<\/code> or\n <code>50%<\/code> means half opacity.\n <\/p>\n <\/dd>\n <dt>14<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <h3 id=\"browser-support-11\">Browser Support<\/h3>\n <p>No browser supports this way of expressing colors yet.<\/p>\n <div class=\"keep-together\">\n <h3 id=\"code-samples-10\">Code Samples<\/h3>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_color.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>Result using the fallback color #780600<\/figcaption>\n <\/figure>\n <\/div>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\"> 1 <\/code><code class=\"p\">:<\/code><code class=\"nd\">root<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 2 <\/code> <code class=\"c\">\/* Use these as fallbacks now *\/<\/code>\n<code class=\"lineno\"> 3 <\/code> <code class=\"err\">--<\/code><code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"mh\">#780600<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 4 <\/code> <code class=\"err\">--<\/code><code class=\"n\">color-alpha<\/code><code class=\"p\">:<\/code><code class=\"mh\">#780600<\/code><code class=\"n\">CC<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 5 <\/code><code class=\"p\">}<\/code>\n<code class=\"lineno\"> 6 <\/code>\n<code class=\"lineno\"> 7 <\/code><code class=\"c\">\/* Defining a new Profile *\/<\/code>\n<code class=\"lineno\"> 8 <\/code><code class=\"p\">@<\/code><code class=\"k\">color-profile<\/code> <code class=\"nt\">sample<\/code> <code class=\"p\">{<\/code>\n<code class=\"lineno\"> 9 <\/code> <code class=\"nt\">src<\/code><code class=\"o\">:<\/code> <code class=\"nt\">url<\/code><code class=\"o\">(<\/code><code class=\"s1\">'https:\/\/howcolors.work\/sample.icc'<\/code><code class=\"o\">);<\/code>\n<code class=\"lineno\">10 <\/code><code class=\"p\">}<\/code>\n<code class=\"lineno\">11 <\/code>\n<code class=\"lineno\">12 <\/code><code class=\"c\">\/* Using the own Profile *\/<\/code>\n<code class=\"lineno\">13 <\/code><code class=\"p\">.<\/code><code class=\"nc\">textsample<\/code> <code class=\"p\">{<\/code> \n<code class=\"lineno\">14 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">15 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">color<\/code><code class=\"p\">(<\/code><code class=\"n\">sample<\/code> <code class=\"mf\">0.4087<\/code> <code class=\"mf\">0.1048<\/code> <code class=\"mi\">0<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">16 <\/code><code class=\"p\">}<\/code>\n<code class=\"lineno\">17 <\/code>\n<code class=\"lineno\">18 <\/code><code class=\"c\">\/* Using the predefined display-p3 Profile *\/<\/code>\n<code class=\"lineno\">19 <\/code><code class=\"p\">.<\/code><code class=\"nc\">textsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">20 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">21 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">color<\/code><code class=\"p\">(<\/code><code class=\"n\">display<\/code><code class=\"o\">-<\/code><code class=\"n\">p3<\/code> <code class=\"mf\">0.4087<\/code> <code class=\"mf\">0.1048<\/code> <code class=\"mi\">0<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">22 <\/code><code class=\"p\">}<\/code>\n<code class=\"lineno\">23 <\/code>\n<code class=\"lineno\">24 <\/code><code class=\"p\">.<\/code><code class=\"nc\">textsample_alpha<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">25 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"o\">-<\/code><code class=\"kc\">alpha<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">26 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">color<\/code><code class=\"p\">(<\/code><code class=\"n\">display<\/code><code class=\"o\">-<\/code><code class=\"n\">p3<\/code> <code class=\"mf\">0.4087<\/code> <code class=\"mf\">0.1048<\/code> <code class=\"mi\">0<\/code> <code class=\"o\">\/<\/code> <code class=\"mf\">.8<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">27 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <\/div>\n <div id=\"colorexercise\" class=\"quiz\">\n <h3 id=\"exercise-6\">Exercise<\/h3>\n <ol class=\"quiz-questions\">\n <li>\n <p>Which notation is invalid?<\/p>\n <ol class=\"quiz-choices\" type=\"a\">\n <li>color(display-p3 0.5 0.5 0.2)<\/li>\n <li>color(display-p3, 0.5 0.5 0.2)<\/li>\n <li>color(a98-rgb 0.2 0.2 0.2)<\/li>\n <\/ol>\n <\/li>\n <li><p>What does the first parameter define?<\/p><\/li>\n <li><p>What range of values you can pass for the second and following parameters?<\/p><\/li>\n <\/ol>\n <\/div>\n <h2 id=\"gray\">Gray<\/h2>\n <p>\n The <code>gray()<\/code> functional notation gives you completely desaturated colors. You only need to pass a single parameter, or two if you want to specify an alpha value. A value of <code>50<\/code>, so\n <code>gray(50)<\/code> would be right between black and white.\n <\/p>\n <div class=\"keep-together\">\n <h3 id=\"syntax-5\">Syntax<\/h3>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_gray.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">gray<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">35<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1<\/dt>\n <dd>\n <p>The function starts with a <code>gray<\/code>.<\/p>\n <\/dd>\n <dt>2<\/dt>\n <dd>An opening bracket follows the function name.<\/dd>\n <dt>3<\/dt>\n <dd>The value for gray <code>50<\/code> would be right between black and white.<\/dd>\n <dt>4<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <div class=\"keep-together\">\n <h4 id=\"alpha-10\">Alpha<\/h4>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/syntax_gray_alpha.png\"\n style=\"width: 100%;\"\n \/>\n <\/figure>\n <\/div>\n <table class=\"with-caption\" style=\"width: 100%;\">\n <caption>\n Breakdown\n <\/caption>\n <thead>\n <tr>\n <th style=\"text-align: center;\">1<\/th>\n <th style=\"text-align: center;\">2<\/th>\n <th style=\"text-align: center;\">3<\/th>\n <th style=\"text-align: center;\">4<\/th>\n <th style=\"text-align: center;\">5<\/th>\n <th style=\"text-align: center;\">6<\/th>\n <th style=\"text-align: center;\">7<\/th>\n <th style=\"text-align: center;\">8<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td style=\"text-align: center;\">gray<\/td>\n <td style=\"text-align: center;\">(<\/td>\n <td style=\"text-align: center;\">35<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">\/<\/td>\n <td style=\"text-align: center;\"><\/td>\n <td style=\"text-align: center;\">50%<\/td>\n <td style=\"text-align: center;\">)<\/td>\n <\/tr>\n <\/tbody>\n <\/table>\n <dl>\n <dt>1 till 3<\/dt>\n <dd>These parts are the same as for the color notation without an alpha value to get details have a look in the section above.<\/dd>\n <dt>4<\/dt>\n <dd>Space as the separator between the color values and the alpha value.<\/dd>\n <dt>5<\/dt>\n <dd>\n <p>A <code>\/<\/code> as the separator between the color values and the alpha value.<\/p>\n <\/dd>\n <dt>6<\/dt>\n <dd>Space.<\/dd>\n <dt>7<\/dt>\n <dd>\n <p>\n You can define the alpha (opacity) value as a number between <code>0<\/code> and <code>1<\/code> or as a percentage. For example, <code>1<\/code> or <code>100%<\/code> means full opacity, while <code>0.5<\/code> or\n <code>50%<\/code> means half opacity.\n <\/p>\n <\/dd>\n <dt>8<\/dt>\n <dd>The functions closing bracket.<\/dd>\n <\/dl>\n <\/div>\n <h3 id=\"browser-support-12\">Browser Support<\/h3>\n <p>No browser supports this way of expressing colors yet.<\/p>\n <div class=\"keep-together\">\n <h3 id=\"code-samples-11\">Code Samples<\/h3>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_gray.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>Result using the fallback color for gray(35)<\/figcaption>\n <\/figure>\n <\/div>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\"> 1 <\/code><code class=\"p\">:<\/code><code class=\"nd\">root<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 2 <\/code> <code class=\"c\">\/* Use these as fallbacks now *\/<\/code>\n<code class=\"lineno\"> 3 <\/code> <code class=\"err\">--<\/code><code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"mh\">#525252<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 4 <\/code> <code class=\"err\">--<\/code><code class=\"n\">color-alpha<\/code><code class=\"p\">:<\/code><code class=\"mh\">#525252<\/code><code class=\"mi\">80<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 5 <\/code><code class=\"p\">}<\/code>\n<code class=\"lineno\"> 6 <\/code>\n<code class=\"lineno\"> 7 <\/code><code class=\"p\">.<\/code><code class=\"nc\">textsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 8 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\"> 9 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nb\">gray<\/code><code class=\"p\">(<\/code><code class=\"mi\">35<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">10 <\/code><code class=\"p\">}<\/code>\n<code class=\"lineno\">11 <\/code>\n<code class=\"lineno\">12 <\/code><code class=\"p\">.<\/code><code class=\"nc\">textsample_alpha<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">13 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"o\">-<\/code><code class=\"kc\">alpha<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">14 <\/code> <code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nb\">gray<\/code><code class=\"p\">(<\/code><code class=\"mi\">35<\/code> <code class=\"o\">\/<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">15 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <\/div>\n <div id=\"grayexercise\" class=\"quiz\">\n <h3 id=\"exercise-7\">Exercise<\/h3>\n <ol class=\"quiz-questions\">\n <li>\n <p>Which notation is invalid?<\/p>\n <ol class=\"quiz-choices\" type=\"a\">\n <li>gray(60 \/ 60%)<\/li>\n <li>gray(70)<\/li>\n <li>gray(10, 100%)<\/li>\n <\/ol>\n <\/li>\n <li><p>What does the first parameter define?<\/p><\/li>\n <li>\n <p>What range of values can you pass for the second parameter?<\/p>\n <ol class=\"quiz-choices\" type=\"a\">\n <li>0 - 100<\/li>\n <li>0 - 255<\/li>\n <li>0 - 360 degree<\/li>\n <\/ol>\n <\/li>\n <\/ol>\n <\/div>\n <img\n alt=\"\"\n class=\"fullscreen\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/howcolors_work_book_new_section-1.png\"\n style=\"width: 100%;\"\n \/>\n <h1 id=\"cool-ways-to-use-colors\">Cool Ways to Use Colors!<\/h1>\n <p>\n In this chapter, I want to show you some cool ways to use colors in CSS. All following examples work with any of the above notations. Of course, you need to keep the notations browser support in mind, and if you use one of the\n new ways add a fallback color.\n <\/p>\n <h2 id=\"text-gradient\">Text Gradient<\/h2>\n <p>The CSS property to change the foreground or text color is <code>color<\/code>. In the examples above I showed you how to set a normal color as text color with the following code.<\/p>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\">1 <\/code><code class=\"p\">.<\/code><code class=\"nc\">textsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">2 <\/code>\t<code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">3 <\/code>\t<code class=\"c\">\/* or *\/<\/code>\n<code class=\"lineno\">4 <\/code>\t<code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"mh\">#FF0000<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">5 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <p>Now the cool part! Did you know you can use a CSS gradient as your text background? To get an idea of what is possible in modern browsers have a look at the screenshot of my personal website.<\/p>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_azettl_net.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>Screenshot of azettl.net<\/figcaption>\n <\/figure>\n <\/div>\n <p>\n The trick here is to use the CSS properties <code>background-clip<\/code> and <code>text-fill-color<\/code>. You can use this if you do not need to\n <a href=\"https:\/\/caniuse.com\/#feat=mdn-css_properties_-webkit-text-fill-color\">support Internet Explorer<\/a>.\n <\/p>\n <p>First, you will have to decide on a CSS gradient you want to use. If you are not sure how to create a gradient you can use any <a href=\"https:\/\/convertingcolors.com\/css-gradient.html\">online generator<\/a> to create one.<\/p>\n <p>Look at the example code from the previous chapters. If you want to use a gradient as text background you will have to change the <code>.textsample<\/code> class.<\/p>\n <p>Additionally to the <code>color<\/code>, you have to set a <code>background-image<\/code>. This is where you pass your gradient, in this example a <code>linear-gradient<\/code>.<\/p>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\">1 <\/code><code class=\"p\">.<\/code><code class=\"nc\">textsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">2 <\/code>\t<code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code> \n<code class=\"lineno\">3 <\/code>\t<code class=\"k\">background-image<\/code><code class=\"p\">:<\/code><code class=\"nb\">linear-gradient<\/code><code class=\"p\">(<\/code><code class=\"mi\">45<\/code><code class=\"kt\">deg<\/code><code class=\"p\">,<\/code><code class=\"mh\">#00b131<\/code> <code class=\"mf\">8.33<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#f93753<\/code> <code class=\"mf\">8.33<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#f9<\/code><code class=\"err\">\\<\/code>\n<code class=\"lineno\">4 <\/code><code class=\"mi\">3753<\/code> <code class=\"mf\">16.67<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#f70<\/code> <code class=\"mf\">16.67<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#f70<\/code> <code class=\"mi\">25<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#edeb00<\/code> <code class=\"mi\">25<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#edeb00<\/code> <code class=\"mf\">33.33<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#195584<\/code> <code class=\"mi\">33<\/code><code class=\"err\">.\\<\/code>\n<code class=\"lineno\">5 <\/code><code class=\"mi\">33<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#195584<\/code> <code class=\"mf\">41.67<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#7b598f<\/code> <code class=\"mf\">41.67<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#7b598f<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#00b131<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#00b131<\/code> <code class=\"mf\">58.33<\/code><code class=\"err\">\\<\/code>\n<code class=\"lineno\">6 <\/code><code class=\"err\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#f93753<\/code> <code class=\"mf\">58.33<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#f93753<\/code> <code class=\"mf\">66.67<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#f70<\/code> <code class=\"mf\">66.67<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#f70<\/code> <code class=\"mi\">75<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#edeb00<\/code> <code class=\"mi\">75<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#edeb0<\/code><code class=\"err\">\\<\/code>\n<code class=\"lineno\">7 <\/code><code class=\"mi\">0<\/code> <code class=\"mf\">83.33<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#195584<\/code> <code class=\"mf\">83.33<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#195584<\/code> <code class=\"mf\">91.67<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#7b598f<\/code> <code class=\"mf\">91.67<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#7b598f<\/code> <code class=\"mi\">100<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">8 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 395px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_text_gradient.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>Current Result<\/figcaption>\n <\/figure>\n <\/div>\n <p>\n Until now you only set the gradient as a background of your element, but the text has still the same color as before. Now you need to add the <code>background-clip<\/code> and <code>text-fill-color<\/code> properties. The\n <code>text-fill-color<\/code> you have to set to <code>transparent<\/code> and the <code>background-clip<\/code> you set to <code>text<\/code>. With this parameters, the background gradient gets clipped to the text and the text gets\n a transparent filling.\n <\/p>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\"> 1 <\/code><code class=\"p\">.<\/code><code class=\"nc\">textsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\"> 2 <\/code>\t<code class=\"k\">color<\/code><code class=\"p\">:<\/code><code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code> \n<code class=\"lineno\"> 3 <\/code>\t<code class=\"k\">background-image<\/code><code class=\"p\">:<\/code><code class=\"nb\">linear-gradient<\/code><code class=\"p\">(<\/code><code class=\"mi\">45<\/code><code class=\"kt\">deg<\/code><code class=\"p\">,<\/code><code class=\"mh\">#00b131<\/code> <code class=\"mf\">8.33<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#f93753<\/code> <code class=\"mf\">8.33<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#f9<\/code><code class=\"err\">\\<\/code>\n<code class=\"lineno\"> 4 <\/code><code class=\"mi\">3753<\/code> <code class=\"mf\">16.67<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#f70<\/code> <code class=\"mf\">16.67<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#f70<\/code> <code class=\"mi\">25<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#edeb00<\/code> <code class=\"mi\">25<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#edeb00<\/code> <code class=\"mf\">33.33<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#195584<\/code> <code class=\"mi\">33<\/code><code class=\"err\">.\\<\/code>\n<code class=\"lineno\"> 5 <\/code><code class=\"mi\">33<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#195584<\/code> <code class=\"mf\">41.67<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#7b598f<\/code> <code class=\"mf\">41.67<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#7b598f<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#00b131<\/code> <code class=\"mi\">50<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#00b131<\/code> <code class=\"mf\">58.33<\/code><code class=\"err\">\\<\/code>\n<code class=\"lineno\"> 6 <\/code><code class=\"err\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#f93753<\/code> <code class=\"mf\">58.33<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#f93753<\/code> <code class=\"mf\">66.67<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#f70<\/code> <code class=\"mf\">66.67<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#f70<\/code> <code class=\"mi\">75<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#edeb00<\/code> <code class=\"mi\">75<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#edeb0<\/code><code class=\"err\">\\<\/code>\n<code class=\"lineno\"> 7 <\/code><code class=\"mi\">0<\/code> <code class=\"mf\">83.33<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#195584<\/code> <code class=\"mf\">83.33<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#195584<\/code> <code class=\"mf\">91.67<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#7b598f<\/code> <code class=\"mf\">91.67<\/code><code class=\"kt\">%<\/code><code class=\"p\">,<\/code><code class=\"mh\">#7b598f<\/code> <code class=\"mi\">100<\/code><code class=\"kt\">%<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\"> 8 <\/code>\t<code class=\"kp\">-webkit-<\/code><code class=\"k\">background-clip<\/code><code class=\"p\">:<\/code><code class=\"kc\">text<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\"> 9 <\/code>\t<code class=\"kp\">-webkit-<\/code><code class=\"n\">text-fill-color<\/code><code class=\"p\">:<\/code><code class=\"kc\">transparent<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">10 <\/code>\t<code class=\"kp\">-moz-<\/code><code class=\"k\">background-clip<\/code><code class=\"p\">:<\/code><code class=\"kc\">text<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">11 <\/code>\t<code class=\"kp\">-moz-<\/code><code class=\"n\">text-fill-color<\/code><code class=\"p\">:<\/code><code class=\"kc\">transparent<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">12 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_text_gradient_result.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>The Final Result<\/figcaption>\n <\/figure>\n <\/div>\n <aside class=\"tip blurb\">\n <p>With the CSS property <code>border-image<\/code> you can use your gradient as border of an element!<\/p>\n <\/aside>\n <h2 id=\"box-shadows-as-borders\">Box Shadows as Borders<\/h2>\n <p>Wanting more than one border on an element is one unusual but cool use case for box shadows. In this example, we will use the <code>.shadowsample<\/code> class of the code from the above chapters.<\/p>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\">1 <\/code><code class=\"p\">.<\/code><code class=\"nc\">shadowsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">2 <\/code>\t<code class=\"k\">text-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">3 <\/code>\t<code class=\"c\">\/* offset-x | offset-y | blur-radius | spread-radius | color *\/<\/code>\n<code class=\"lineno\">4 <\/code>\t<code class=\"k\">box-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">5 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <p>Let\u2019s get rid of the blur and spread-radius first.<\/p>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\">1 <\/code><code class=\"p\">.<\/code><code class=\"nc\">shadowsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">2 <\/code>\t<code class=\"k\">text-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">3 <\/code>\t<code class=\"c\">\/* offset-x | offset-y | blur-radius | spread-radius | color *\/<\/code>\n<code class=\"lineno\">4 <\/code>\t<code class=\"k\">box-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">0<\/code> <code class=\"mi\">0<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">5 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 395px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_box_shadow.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>The result without blur and spread-radius<\/figcaption>\n <\/figure>\n <\/div>\n <p>The <code>box-shadow<\/code> property allows you to pass multiple shadows by separating them with a comma. This you can use to create a basic border effect by adjusting the offset parameters.<\/p>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\">1 <\/code><code class=\"p\">.<\/code><code class=\"nc\">shadowsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">2 <\/code>\t<code class=\"k\">text-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">3 <\/code>\t<code class=\"c\">\/* offset-x | offset-y | blur-radius | spread-radius | color *\/<\/code>\n<code class=\"lineno\">4 <\/code>\t<code class=\"k\">box-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">0<\/code> <code class=\"mi\">0<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">),<\/code> <code class=\"mi\">-4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">0<\/code> <code class=\"mi\">0<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">),<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">-4<\/code><code class=\"err\">\\<\/code>\n<code class=\"lineno\">5 <\/code><code class=\"n\">px<\/code> <code class=\"mi\">0<\/code> <code class=\"mi\">0<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">),<\/code> <code class=\"mi\">-4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">-4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">0<\/code> <code class=\"mi\">0<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">6 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_box_shadow_border_effect.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>A single border via the box-shadow property<\/figcaption>\n <\/figure>\n <\/div>\n <p>To add a second border around the first, all you need to do is add another set of box shadows. I use 8 pixels as an offset to get the same border width and the hex color <code>#edeb00<\/code> as border color.<\/p>\n <figure class=\"code\" dir=\"ltr\">\n <div class=\"highlight\">\n <pre><code><\/code><code class=\"lineno\">1 <\/code><code class=\"p\">.<\/code><code class=\"nc\">shadowsample<\/code><code class=\"p\">{<\/code>\n<code class=\"lineno\">2 <\/code>\t<code class=\"k\">text-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">);<\/code>\n<code class=\"lineno\">3 <\/code>\t<code class=\"c\">\/* offset-x | offset-y | blur-radius | spread-radius | color *\/<\/code>\n<code class=\"lineno\">4 <\/code>\t<code class=\"k\">box-shadow<\/code><code class=\"p\">:<\/code><code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">0<\/code> <code class=\"mi\">0<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">),<\/code> <code class=\"mi\">-4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">0<\/code> <code class=\"mi\">0<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">),<\/code> <code class=\"mi\">4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">-4<\/code><code class=\"err\">\\<\/code>\n<code class=\"lineno\">5 <\/code><code class=\"n\">px<\/code> <code class=\"mi\">0<\/code> <code class=\"mi\">0<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">),<\/code> <code class=\"mi\">-4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">-4<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">0<\/code> <code class=\"mi\">0<\/code> <code class=\"nf\">var<\/code><code class=\"p\">(<\/code><code class=\"o\">--<\/code><code class=\"kc\">color<\/code><code class=\"p\">),<\/code> <code class=\"mi\">8<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">8<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">0<\/code> <code class=\"mi\">0<\/code> <code class=\"mh\">#edeb00<\/code><code class=\"p\">,<\/code> <code class=\"o\">-<\/code><code class=\"err\">\\<\/code>\n<code class=\"lineno\">6 <\/code><code class=\"mi\">8<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">8<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">0<\/code> <code class=\"mi\">0<\/code> <code class=\"mh\">#edeb00<\/code><code class=\"p\">,<\/code> <code class=\"mi\">8<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">-8<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">0<\/code> <code class=\"mi\">0<\/code> <code class=\"mh\">#edeb00<\/code><code class=\"p\">,<\/code> <code class=\"mi\">-8<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">-8<\/code><code class=\"kt\">px<\/code> <code class=\"mi\">0<\/code> <code class=\"mi\">0<\/code> <code class=\"mh\">#edeb00<\/code><code class=\"p\">;<\/code>\n<code class=\"lineno\">7 <\/code><code class=\"p\">}<\/code>\n<\/pre>\n <\/div>\n <\/figure>\n <div class=\"figure-wrapper center\">\n <figure class=\"image block\" style=\"width: 396px;\">\n <img\n alt=\"\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/screen_box_shadow_2_border_effect.png\"\n style=\"width: 100%;\"\n \/>\n <figcaption>Two borders via the box-shadow property<\/figcaption>\n <\/figure>\n <\/div>\n <aside class=\"tip blurb\">\n <p>This way you can even add a third, fourth, or any amount of borders to your element.<\/p>\n <\/aside>\n <img\n alt=\"\"\n class=\"fullscreen\"\n src=\"https:\/\/raw.githubusercontent.com\/azettl\/printcss.examples\/main\/HTML%20Examples\/Books%20and%20Magazines\/howcolors.work\/assets\/howcolors_work_book_thanks.png\"\n style=\"width: 100%;\"\n \/>\n <h1 id=\"answers\">Answers to Exercises<\/h1>\n <div class=\"answers\">\n <h3 id=\"current-ways-to-express-colors-1\">Current Ways to Express Colors!<\/h3>\n <ol class=\"question-list\">\n <li>\n 4\n <\/li>\n <li>\n 40%\n <\/li>\n <li>\n 4096\n <\/li>\n <li>\n rgb(255 100 100, 100%)\n <\/li>\n <li>\n Green\n <\/li>\n <li>\n 0 - 255\n <\/li>\n <li>\n hsl(300 100 50)\n <\/li>\n <li>\n Lightness\n <\/li>\n <li>\n 240 degree\n <\/li>\n <\/ol>\n <h3 id=\"new-ways-to-express-colors-1\">New Ways to Express Colors!<\/h3>\n <ol class=\"question-list\">\n <li>\n hwb(300deg, 50, 50)\n <\/li>\n <li>\n Hue\n <\/li>\n <li>\n 120 degree\n <\/li>\n <li>\n lab(100%, 100, 160)\n <\/li>\n <li>\n The distance along the a-axises in the Lab colorspace.\n <\/li>\n <li>\n 0 - 400%\n <\/li>\n <li>\n lch(50% 50 380deg)\n <\/li>\n <li>\n Hue\n <\/li>\n <li>\n 0 - 230\n <\/li>\n <li>\n color(display-p3, 0.5 0.5 0.2)\n <\/li>\n <li>\n The ICC color profile\n <\/li>\n <li>\n Depends on the color space but usually 0 - 1.\n <\/li>\n <li>\n gray(10, 100%)\n <\/li>\n <li>\n The value for gray.\n <\/li>\n <li>\n 0 - 100\n <\/li>\n <\/ol>\n <\/div>\n <\/body>\n<\/html>", "css": "@import url('https:\/\/fonts.googleapis.com\/css2?family=Libre+Caslon+Text:ital,wght@0,400;0,700;1,400&display=swap');\n\n@page{\n\tsize:14.8cm 21cm; \/* A5 Format https:\/\/formaty.info\/en\/A5\/ *\/\n}\n\n@page:left{\n margin:2cm 2cm 2cm 1.5cm;\n\n @top-center {\n font-size:10pt;\n content: string(heading, first);\n }\n\n @top-left{\n font-size:10pt;\n content: counter(page);\n }\n}\n\n@page:right{\n margin:2cm 1.5cm 2cm 2cm;\n\n @top-center {\n font-size:10pt;\n content: string(heading, first);\n }\n\n @top-right{\n font-size:10pt;\n content: counter(page);\n }\n}\n\n@page pagewithoutheader{\n @top-center {\n content: \"\";\n }\n \n @top-left{\n content: \"\";\n }\n \n @top-right{\n content: \"\";\n }\n}\n\n@page fullscreenimage{\n margin:0;\n background-color:#128458;\n\n @top-center {\n content: \"\";\n }\n \n @top-left{\n content: \"\";\n }\n \n @top-right{\n content: \"\";\n }\n}\n\nbody{\n\tmargin:0;\n\tpadding:0;\n\tfont-size:12pt;\n direction: ltr;\n font-family: 'Libre Caslon Text', serif;\n}\n\nh1,\nh2{\n page-break-before: always;\n break-before: always;\n}\n\nh1 + h2{\n page-break-before: avoid;\n break-before: avoid;\n}\n\nh1{\n string-set: heading content();\n}\n\n.quiz,\n.keep-together,\nfigure.image{\n break-inside: avoid;\n page-break-inside: avoid;\n}\n\nimg.fullscreen{\n page: fullscreenimage;\n display:block;\n max-width:100%;\n min-width:100%;\n}\n\n.pagewithoutheader{\n page: pagewithoutheader;\n}\n\nul.toc {\n margin: 0;\n padding: 0;\n overflow: hidden;\n list-style: none;\n}\n\nul.toc li ul{\n list-style: none;\n}\n\nul.toc li:after {\n float: left;\n width: 0;\n white-space: nowrap;\n content:\n\". . . . . . . . . . . . . . . . . . . . \"\n\". . . . . . . . . . . . . . . . . . . . \"\n\". . . . . . . . . . . . . . . . . . . . \"\n\". . . . . . . . . . . . . . . . . . . . \"\n}\n\nul.toc a{\n color:inherit;\n text-decoration: none;\n}\n\nul.toc a:first-child {\n padding-right: 0.33em;\n background: white\n}\n\nul.toc a + a::after {\n float: right;\n padding-left: 0.33em;\n background: white;\n position: relative;\n z-index: 1;\n content: target-counter(attr(href), page); \n}\n\n.code pre{\n white-space: pre-wrap; \n}\n\na{\n color:inherit;\n text-decoration:none;\n}\n\na:not([href^=\"#\"])::after {\n float:footnote;\n content: \" (\"attr(href)\")\";\n font-style: italic;\n break-inside: avoid;\n page-break-inside: avoid;\n}\n\n.note{\n float:footnote;\n font-style: italic;\n break-inside: avoid;\n page-break-inside: avoid;\n}\n\nfigure{\n width:100%;\n margin:0 auto;\n}\n\nfigcaption,\ncaption{\n font-size:10pt;\n text-align: center;\n}\n\nh1 {\n font-size: 1.5em;\n margin-top: 10%;\n margin-bottom: 1em;\n}\n\nh2 {\n font-size: 1.17em;\n margin-top: 1em;\n margin-bottom: 0.25em;\n}\n\nh3 { \n margin-top: 1em;\n font-size: 1.12em;\n margin-bottom: 0.25em;\n}\n\nh4 {\n margin-top: 1em;\n font-size: 1em;\n margin-bottom: 0.25em;\n}\n\/* general text *\/\n\np {\n text-indent: 0em;\n margin-top: 0.5em;\n}\n\nblockquote { margin-left: 2em; }\n\nspan.lineno, code.lineno {\n color: gray;\n font-size: 80%;\n}\n\n\/* force some space before and after code blocks *\/\npre {\n margin-top: 0.5em;\n margin-bottom: 0.5em;\n font-family: monospace;\n}\n\n\/* styles for inserted (uil) and deleted (udl) lines *\/\n.udl {\n text-decoration: line-through;\n}\n\n.uil {\n font-weight: 900;\n}\n\n.err { color: #FF0000 }\n\n\/* ============================================================================== *\/\n\/* everything below this line is generated by rake book_generator:pygments_styles *\/\n.hll { background-color: #ffffcc }\n.c { color: #408080; font-style: italic } \/* Comment *\/\n.err { color: #FF0000 } \/* Error *\/\n.k { color: #008000; font-weight: bold } \/* Keyword *\/\n.o { color: #666666 } \/* Operator *\/\n.cm { color: #408080; font-style: italic } \/* Comment.Multiline *\/\n.cp { color: #BC7A00 } \/* Comment.Preproc *\/\n.c1 { color: #408080; font-style: italic } \/* Comment.Single *\/\n.cs { color: #408080; font-style: italic } \/* Comment.Special *\/\n.gd { color: #A00000 } \/* Generic.Deleted *\/\n.ge { font-style: italic } \/* Generic.Emph *\/\n.gr { color: #FF0000 } \/* Generic.Error *\/\n.gh { color: #000080; font-weight: bold } \/* Generic.Heading *\/\n.gi { color: #00A000 } \/* Generic.Inserted *\/\n.go { color: #808080 } \/* Generic.Output *\/\n.gp { color: #000080; font-weight: bold } \/* Generic.Prompt *\/\n.gs { font-weight: bold } \/* Generic.Strong *\/\n.gu { color: #800080; font-weight: bold } \/* Generic.Subheading *\/\n.gt { color: #0040D0 } \/* Generic.Traceback *\/\n.kc { color: #008000; font-weight: bold } \/* Keyword.Constant *\/\n.kd { color: #008000; font-weight: bold } \/* Keyword.Declaration *\/\n.kn { color: #008000; font-weight: bold } \/* Keyword.Namespace *\/\n.kp { color: #008000 } \/* Keyword.Pseudo *\/\n.kr { color: #008000; font-weight: bold } \/* Keyword.Reserved *\/\n.kt { color: #B00040 } \/* Keyword.Type *\/\n.m { color: #666666 } \/* Literal.Number *\/\n.s { color: #BA2121 } \/* Literal.String *\/\n.na { color: #7D9029 } \/* Name.Attribute *\/\n.nb { color: #008000 } \/* Name.Builtin *\/\n.nc { color: #0000FF; font-weight: bold } \/* Name.Class *\/\n.no { color: #880000 } \/* Name.Constant *\/\n.nd { color: #AA22FF } \/* Name.Decorator *\/\n.ni { color: #999999; font-weight: bold } \/* Name.Entity *\/\n.ne { color: #D2413A; font-weight: bold } \/* Name.Exception *\/\n.nf { color: #0000FF } \/* Name.Function *\/\n.nl { color: #A0A000 } \/* Name.Label *\/\n.nn { color: #0000FF; font-weight: bold } \/* Name.Namespace *\/\n.nt { color: #008000; font-weight: bold } \/* Name.Tag *\/\n.nv { color: #19177C } \/* Name.Variable *\/\n.ow { color: #AA22FF; font-weight: bold } \/* Operator.Word *\/\n.w { color: #bbbbbb } \/* Text.Whitespace *\/\n.mf { color: #666666 } \/* Literal.Number.Float *\/\n.mh { color: #666666 } \/* Literal.Number.Hex *\/\n.mi { color: #666666 } \/* Literal.Number.Integer *\/\n.mo { color: #666666 } \/* Literal.Number.Oct *\/\n.sb { color: #BA2121 } \/* Literal.String.Backtick *\/\n.sc { color: #BA2121 } \/* Literal.String.Char *\/\n.sd { color: #BA2121; font-style: italic } \/* Literal.String.Doc *\/\n.s2 { color: #BA2121 } \/* Literal.String.Double *\/\n.se { color: #BB6622; font-weight: bold } \/* Literal.String.Escape *\/\n.sh { color: #BA2121 } \/* Literal.String.Heredoc *\/\n.si { color: #BB6688; font-weight: bold } \/* Literal.String.Interpol *\/\n.sx { color: #008000 } \/* Literal.String.Other *\/\n.sr { color: #BB6688 } \/* Literal.String.Regex *\/\n.s1 { color: #BA2121 } \/* Literal.String.Single *\/\n.ss { color: #19177C } \/* Literal.String.Symbol *\/\n.bp { color: #008000 } \/* Name.Builtin.Pseudo *\/\n.vc { color: #19177C } \/* Name.Variable.Class *\/\n.vg { color: #19177C } \/* Name.Variable.Global *\/\n.vi { color: #19177C } \/* Name.Variable.Instance *\/\n.il { color: #666666 } \/* Literal.Number.Integer.Long *\/", "options": { "renderer": "weasyprint" } }