<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: dancing-koala</title>
    <description>The latest articles on DEV Community by dancing-koala (@dancingkoala).</description>
    <link>https://dev.to/dancingkoala</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F25732%2Fb03db187-ce97-45fa-97a9-22ea4ee703a2.png</url>
      <title>DEV Community: dancing-koala</title>
      <link>https://dev.to/dancingkoala</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dancingkoala"/>
    <language>en</language>
    <item>
      <title>Brain &amp; color contrast</title>
      <dc:creator>dancing-koala</dc:creator>
      <pubDate>Fri, 20 Sep 2019 13:00:18 +0000</pubDate>
      <link>https://dev.to/dancingkoala/brain-color-contrast-2c65</link>
      <guid>https://dev.to/dancingkoala/brain-color-contrast-2c65</guid>
      <description>&lt;p&gt;The following is a short story about us, humans, being slaves of our perception.&lt;/p&gt;

&lt;p&gt;As most people, I know my brain can be playful when interpreting what my eyes see but it never happened to me with software development.&lt;/p&gt;

&lt;p&gt;I did a first version of a website for a customer of mine, it contained several light gray banners over white background as follows:&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/fkmzLsda//embedded/result,html,css//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Nothing crazy here. For a second version, my customer asked me to add texture to the background, like paper texture. Ok fine, I go to &lt;a href="https://www.transparenttextures.com/"&gt;Transparent textures&lt;/a&gt;, grab the "paper beige" one and apply it to my body tag.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WTF! The gray banners are now white!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Why is that happening ? Does Chrome try to enhance contrast for legibility ? Did I accidentally change a property ? Did someone cast a voodoo spell on my website ?&lt;/p&gt;

&lt;p&gt;After a dozen minutes browsing CSS properties of all the tags potentially incriminated, I used the &lt;a href="https://kde.org/applications/graphics/org.kde.kcolorchooser"&gt;KDE color picker&lt;/a&gt; to check the actual color of the banner.&lt;/p&gt;

&lt;p&gt;As you can expect, it was just the same as before, the change was only in my brain. Because of the texture being of a much darker gray than the banner, &lt;strong&gt;the contrast changed&lt;/strong&gt; from light gray over white (dark over light) to light gray over darker gray (light over dark).&lt;/p&gt;

&lt;p&gt;You can experience it &lt;a href="https://jsfiddle.net/ao82hrt4/18/"&gt;with this JSFiddle&lt;/a&gt;. The effect is much lesser than on a fullscreen page but you can still experience it (I tried embedding it but dev.to's light theme kills the illusion).&lt;/p&gt;

&lt;p&gt;Lesson learnt: only check your CSS after checking your own brain ;)&lt;/p&gt;

</description>
      <category>css</category>
      <category>illusion</category>
      <category>contrast</category>
      <category>short</category>
    </item>
  </channel>
</rss>
