Converting RGB to HEX code by consider rgb as a string in java
<p>in my project I try to convert <code>rgb</code> value consider as a string to <code>hex</code> value  i have tried below code but didn't help a bit..plz.help me.  </p>

<pre><code>    String myColorString = "rgb(26,33,37)";
    int color = Integer.parseInt(myColorString, 16);
    int r = (color &gt;&gt; 16) &amp; 0xFF;
    int g = (color &gt;&gt; 8) &amp; 0xFF;
    int b = (color &gt;&gt; 0) &amp; 0xFF;
    FooterColor.setBackgroundColor(Color.rgb(r, g, b)); 
</code></pre>
