<?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: Vibetool Builder</title>
    <description>The latest articles on DEV Community by Vibetool Builder (@vibetool_builder_070).</description>
    <link>https://dev.to/vibetool_builder_070</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4244102%2F6ad119ef-293e-43a7-9c2b-fb269e541a3b.png</url>
      <title>DEV Community: Vibetool Builder</title>
      <link>https://dev.to/vibetool_builder_070</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vibetool_builder_070"/>
    <language>en</language>
    <item>
      <title>Better HTML Color Codes Explained: HEX, RGB and HSL for Beginners</title>
      <dc:creator>Vibetool Builder</dc:creator>
      <pubDate>Sat, 14 Nov 2026 08:15:44 +0000</pubDate>
      <link>https://dev.to/vibetool_builder_070/better-html-color-codes-explained-hex-rgb-and-hsl-for-beginners-1kkb</link>
      <guid>https://dev.to/vibetool_builder_070/better-html-color-codes-explained-hex-rgb-and-hsl-for-beginners-1kkb</guid>
      <description>&lt;p&gt;Every web developer hits this moment: you see &lt;code&gt;#E93C5E&lt;/code&gt; in a stylesheet and wonder what it actually means. Here's a quick guide to HTML color codes, with examples you can copy.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a HEX color code?
&lt;/h2&gt;

&lt;p&gt;A HEX code is a &lt;code&gt;#&lt;/code&gt; followed by six characters. Each pair is the amount of &lt;strong&gt;red, green, and blue&lt;/strong&gt; (0-255, written in base 16).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#E93C5E
 │ │ │
 │ │ └─ Blue  = 5E = 94
 │ └─── Green = 3C = 60
 └───── Red   = E9 = 233
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So &lt;code&gt;#E93C5E&lt;/code&gt; is the same as &lt;code&gt;rgb(233, 60, 94)&lt;/code&gt;. &lt;code&gt;00&lt;/code&gt; means none of that color, and &lt;code&gt;FF&lt;/code&gt; means the maximum.&lt;/p&gt;

&lt;h2&gt;
  
  
  The same color in three formats
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#E93C5E&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;233&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;94&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;348&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="kt"&gt;%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;57&lt;/span&gt;&lt;span class="kt"&gt;%&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All three produce the same pink-red. Which one should you use?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HEX&lt;/strong&gt;: compact and universal. Great for brand colors you paste around.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RGB&lt;/strong&gt;: easy to reason about when you need to mix channels or add transparency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HSL&lt;/strong&gt;: the most human-friendly. &lt;strong&gt;H&lt;/strong&gt;ue is the color (0-360°), &lt;strong&gt;S&lt;/strong&gt;aturation is how vivid it is, and &lt;strong&gt;L&lt;/strong&gt;ightness is how light or dark. To make a hover state, keep the hue and drop the lightness a few points.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Shorthand and transparency
&lt;/h2&gt;

&lt;p&gt;If each pair repeats its digit, you can shorten the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nn"&gt;#fff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;      &lt;span class="cm"&gt;/* same as #ffffff */&lt;/span&gt;
&lt;span class="nt"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nn"&gt;#09c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;      &lt;span class="cm"&gt;/* same as #0099cc */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also add two more characters at the end for &lt;strong&gt;alpha&lt;/strong&gt; (transparency):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nn"&gt;#6366f180&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="cm"&gt;/* indigo at ~50% opacity */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Named colors
&lt;/h2&gt;

&lt;p&gt;CSS also has about 140 named colors, such as &lt;code&gt;tomato&lt;/code&gt;, &lt;code&gt;teal&lt;/code&gt;, and &lt;code&gt;rebeccapurple&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tomato&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;  &lt;span class="cm"&gt;/* #ff6347 */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;They're handy for quick demos, but real projects usually use HEX or HSL so colors stay consistent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding colors quickly
&lt;/h2&gt;

&lt;p&gt;Picking colors from memory doesn't work. I put together a free page where you can &lt;strong&gt;browse colors by family&lt;/strong&gt; (red, orange, teal, purple, pastel, dark, and more), jump to a specific HEX code or hue, and copy any color in one click:&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://uicolorblocks.com/colors" rel="noopener noreferrer"&gt;HTML Color Codes &amp;amp; HEX Color Browser&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you already have a code and need it in another format, a converter helps. This one handles HEX, RGB, HSL, CMYK, and OKLCH: &lt;a href="https://uicolorblocks.com/converter" rel="noopener noreferrer"&gt;Color Code Converter&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't forget readability
&lt;/h2&gt;

&lt;p&gt;A color can look great and still be hard to read. Text and background need enough contrast, and WCAG asks for at least &lt;strong&gt;4.5:1&lt;/strong&gt; for normal text. Always test your pairs: &lt;a href="https://uicolorblocks.com/contrast-guide" rel="noopener noreferrer"&gt;WCAG Contrast Checker&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick cheat sheet
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Format&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;th&gt;Good for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;HEX&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#E93C5E&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Brand colors, copy/paste&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RGB&lt;/td&gt;
&lt;td&gt;&lt;code&gt;rgb(233, 60, 94)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Channel math, opacity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HSL&lt;/td&gt;
&lt;td&gt;&lt;code&gt;hsl(348, 80%, 57%)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Hover states, themes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Named&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tomato&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Quick demos&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;Once you know that HEX is just red, green, and blue in base 16, color codes stop looking like random characters. Which format do you reach for most, and do you ever use HSL? Let me know in the comments.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>design</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
