<?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>Forem: Cleyson Reinhold</title>
    <description>The latest articles on Forem by Cleyson Reinhold (@cgreinhold).</description>
    <link>https://forem.com/cgreinhold</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%2F126433%2Fdb2a5865-7001-4906-969a-f0baa469e6bf.jpeg</url>
      <title>Forem: Cleyson Reinhold</title>
      <link>https://forem.com/cgreinhold</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/cgreinhold"/>
    <language>en</language>
    <item>
      <title>Pixel art with linear-gradient</title>
      <dc:creator>Cleyson Reinhold</dc:creator>
      <pubDate>Tue, 04 Feb 2020 01:03:13 +0000</pubDate>
      <link>https://forem.com/cgreinhold/pixel-art-with-linear-gradient-5h3b</link>
      <guid>https://forem.com/cgreinhold/pixel-art-with-linear-gradient-5h3b</guid>
      <description>&lt;p&gt;Some time ago I read &lt;a href="https://css-tricks.com/fun-times-css-pixel-art/"&gt;this article&lt;/a&gt; exmplaining how to create pixel art using CSS with the &lt;code&gt;box-shadow&lt;/code&gt; property. This is a really cool technique and today you can even find tools in the web to easily create them.&lt;/p&gt;

&lt;p&gt;Recently I've been working with CSS's &lt;code&gt;linear-gradients&lt;/code&gt; and discovered that it's also possible to create pixel art with it. The idea behind this is to set a lot of &lt;code&gt;linear-gradients&lt;/code&gt; in the same &lt;code&gt;background-image&lt;/code&gt; creating the desired image.&lt;/p&gt;

&lt;h2&gt;
  
  
  Beginning
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;linear-gradient&lt;/code&gt; is basically a CSS way to add gradients in a background. With this property we can do vertical (&lt;code&gt;background-image: linear-gradient(black, red);&lt;/code&gt;) and horizontal (&lt;code&gt;background-image: linear-gradient(to right, black, red);&lt;/code&gt;) gradients.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Colors
&lt;/h2&gt;

&lt;p&gt;It is also possible to add more than two colors in a &lt;code&gt;linear-gradient&lt;/code&gt; up to an ilimited number (&lt;code&gt;background-image: linear-gradient(to right, black, red, orange, yellow, white);&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Not only that, but the &lt;code&gt;linear-gradient&lt;/code&gt; allows you to set a percent defining at which part of the background the color will begin (&lt;code&gt;background-image: linear-gradient(to right, black, red 20%);&lt;/code&gt;).&lt;/p&gt;

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

&lt;h2&gt;
  
  
  "Cheating" the gradient
&lt;/h2&gt;

&lt;p&gt;When repeating the same color two times, the percent given to the second one defines the place it ends on the gradient. With this percent we can begin to "cheat" the gradient and setting two separated colors next to each other (&lt;code&gt;background-image: linear-gradient(to right, black 0%, black 20%, red 20%);&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;This same way, using more colors it's possible to create a full row of pixels of an image (&lt;code&gt;background-image: linear-gradient(to right, black 0%, black 20%, red 20%, red 40%, orange 40%, orange 60%, yellow 60%, yellow 80%, green 80%);&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;background-color&lt;/code&gt; also accepts more than one &lt;code&gt;linear-gradient&lt;/code&gt; so with this we can draw our next rows. We just need to take care of the &lt;code&gt;background-size&lt;/code&gt;. Since we have more than one &lt;code&gt;linear-gradient&lt;/code&gt;, we need to define a size for each one, in order for all of them to be visible. We also need to make sure that the background don't repeat itself (&lt;code&gt;background-repeat: no-repeat; background-image: linear-gradient(to right, black 0%, black 20%, red 20%, red 40%, orange 40%, orange 60%, yellow 60%, yellow 80%, green 80%), linear-gradient(to right, green 0%, green 20%, yellow 20%, yellow 40%, orange 40%, orange 60%, red 60%, red 80%, black 80%); background-size: 200px 25px, 200px 50px;&lt;/code&gt;).&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Summing everything up
&lt;/h2&gt;

&lt;p&gt;Summing everything up, and using te right colors and right orders, we can create a full pixel art with this technique as you can see below.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Final words
&lt;/h2&gt;

&lt;p&gt;Pretty weird huh? Can you also do some image using this technique? Why don't you try?&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>pixelart</category>
    </item>
    <item>
      <title>Clippy revival</title>
      <dc:creator>Cleyson Reinhold</dc:creator>
      <pubDate>Sun, 25 Aug 2019 23:12:07 +0000</pubDate>
      <link>https://forem.com/cgreinhold/clippy-revival-bmo</link>
      <guid>https://forem.com/cgreinhold/clippy-revival-bmo</guid>
      <description>&lt;p&gt;For many people Office's Clippy was the first virtual assistant before chatbots where everywhere around. Many people still miss it and it's random tips.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.smore.com/clippy-js"&gt;Clippy.js&lt;/a&gt; is one of the projects that aimed to revive Clippy "to any website for instant nostalgia".&lt;/p&gt;

&lt;p&gt;Based on this JS library and using Electron, the javascript framework that everyone loves to hate, I created the &lt;a href="https://github.com/CGReinhold/desktopclippy"&gt;Desktop Clippy&lt;/a&gt;, a Clippy adaptation that will give you a random quote every 10 minutes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lSsM8xxp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/8oc10jkt5me6640i5nj7.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lSsM8xxp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/8oc10jkt5me6640i5nj7.gif" alt="Desktop Clippy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm sure that is not the best idea for an Electron application, but suits well for a fun weekend project and to try out different technologies.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>electron</category>
    </item>
  </channel>
</rss>
