title: Converting HEX to RGBa
body: <p>I want to convert HEX color in RGB, but searching on the web I understood that I can do it with SASS but only with <strong>RGBa</strong>.</p>
  
  <p>So consider this code:</p>
  
  <pre><code>@mixin hex-rgba($hexcolor, $opacity) {
    background-color: rgba($hexcolor, $opacity); 
  }
  
  div {
    @include hex-rgba(#333333, .3);
  }
  </code></pre>
  
  <p>It returns:</p>
  
  <pre><code>div {
    background-color: rgba(51, 51, 51, 0.3);
  }
  </code></pre>
  
  <p>But if i set alpha to 1 (or 100%) it returns the hex value:</p>
  
  <pre><code>div {
    @include hex-rgba(#333333, 1);
  }
  
  div {
    background-color: #333333;
  }
  </code></pre>
  
  <p>How can I obtain the rgba value even if alpha is 100%?</p>
  
  <p>In a way like</p>
  
  <pre><code>div {
    background-color: rgba(51, 51, 51, 1);
  }
  </code></pre>
  
  <p><strong>SOLVED</strong></p>
  
  <pre><code>@function rgb($hexcolor){
    $red:red($hexcolor);
    $green:green($hexcolor);
    $blue:blue($hexcolor);
    $alpha:alpha($hexcolor);
    @return unquote("rgb(#{$red},#{$green},#{$blue})");
  }
  
  :root {
    --color: #{rgb(#ffffff)};
  }
  </code></pre>