<?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: Yash Purohit</title>
    <description>The latest articles on DEV Community by Yash Purohit (@y1a2s3h4).</description>
    <link>https://dev.to/y1a2s3h4</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%2F530825%2Faac319c3-07e1-4fc8-9a3c-6e8cf7acb6ba.jpeg</url>
      <title>DEV Community: Yash Purohit</title>
      <link>https://dev.to/y1a2s3h4</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/y1a2s3h4"/>
    <language>en</language>
    <item>
      <title>RGB Color to HEXA Color Converter Using HTML, CSS, JS</title>
      <dc:creator>Yash Purohit</dc:creator>
      <pubDate>Sun, 17 Jan 2021 12:02:19 +0000</pubDate>
      <link>https://dev.to/y1a2s3h4/create-a-small-project-which-converts-rgb-color-to-hexa-color-code-1gfp</link>
      <guid>https://dev.to/y1a2s3h4/create-a-small-project-which-converts-rgb-color-to-hexa-color-code-1gfp</guid>
      <description>&lt;p&gt;It's my first blog post. I created this project a while ago thought to create a blog post on it. &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;I assume that you know JavaScript, CSS, and HTML well and you are just here to know how it's created.&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;User will able to convert with a range slider and also with the input also there will be a div which will preview the color.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Create a folder name it whichever you like to give.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create files and folder structure as given below.&lt;/strong&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KlG2rg07--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/shn1tsbvq1sljavfk25s.png" alt="Alt Text"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will use bootstrap for designing faster and easier. Add &lt;a href="https://getbootstrap.com/docs/4.5/getting-started/introduction/"&gt;Bootstrap&lt;/a&gt; CDN links in HTML.&lt;/p&gt;

&lt;h2&gt;
  
  
  Open HTML file.
&lt;/h2&gt;

&lt;p&gt;Add &lt;a href="https://getbootstrap.com/docs/4.5/getting-started/introduction/"&gt;Bootstrap&lt;/a&gt; CDN links in HTML.&lt;/p&gt;

&lt;p&gt;Now, write the HTML code. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can structure your code in your way. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We can see the HTML part below images:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4U0LfoZL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/znb7vyh262u37t1qtr2d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4U0LfoZL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/znb7vyh262u37t1qtr2d.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LY6_F5Gf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/abylhzeeqnxghpp3b6lb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LY6_F5Gf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/abylhzeeqnxghpp3b6lb.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Now, Open the CSS file.
&lt;/h2&gt;

&lt;p&gt;It's time to give a good design:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--18-phozs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gx741we4hmbqybskq1yc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--18-phozs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gx741we4hmbqybskq1yc.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Open JS file.
&lt;/h2&gt;

&lt;p&gt;The fun part begins here. Firstly we will declare all and refer to all our main elements.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lNWazoUI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/mrjc92164nptnwdzx2jf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lNWazoUI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/mrjc92164nptnwdzx2jf.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we will add all our event handlers. As you can see in the below image for the range slider I have used  OnInput event rather than using onChange because OnInput occurs immediately and OnChange occurs when the element loses focus, after the content has been changed. Before using OnInput I used the OnChange event but didn't get the result as expected so I searched for it and got an answer in &lt;/p&gt;
&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pTF_nE4a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/20353686/why-is-onchange-event-not-firing-on-first-change/20354341#20354341" rel="noopener noreferrer"&gt;
              &lt;span class="title-flare"&gt;answer&lt;/span&gt; re:  Why is onchange event not firing on first change?
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Dec  3 '13&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/20353686/why-is-onchange-event-not-firing-on-first-change/20354341#20354341" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5MiFESHx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          3
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rk_a5QFN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;If I understand the question correctly, the problem is that on Firefox, the &lt;code&gt;onchange&lt;/code&gt; handler is not executed when you press down mouse button when the cursor is on the button of the slider and move the mouse. It is executed only after you release the mouse button after such…&lt;/p&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/20353686/why-is-onchange-event-not-firing-on-first-change/20354341#20354341" rel="noopener noreferrer"&gt;Open Full Answer&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IDjaRfHP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2enydsmtyc4zlzsv9d5h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IDjaRfHP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2enydsmtyc4zlzsv9d5h.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LhqjTNsr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/uah3usp4t2s4nyd6a0my.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LhqjTNsr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/uah3usp4t2s4nyd6a0my.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Boom!&lt;/strong&gt; ✨
&lt;/h1&gt;

&lt;p&gt;Here's the preview:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--voLAzZCO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1waynyb7lz4owez6ctq9.png" alt="Alt Text"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FiCwtEeO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/a7jg8eqoa6kel19h4m64.gif" alt="Alt Text"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Check Out &lt;a href="https://github.com/Y1a2s3h4/RGB-to-Hex-Color-Converter/"&gt;Github Repo&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Thanks For Reading My Blog Post.&lt;/strong&gt;
&lt;/h2&gt;

</description>
      <category>javascript</category>
      <category>html</category>
      <category>css</category>
      <category>rgbtohexa</category>
    </item>
  </channel>
</rss>
