title: getCssValue (Color) in Hex format in Selenium WebDriver
body: <p>In the following code I need to print the <code>color</code> in <code>Hex format</code>. </p>
  
  <p><em>First</em> Print statement is showing value in <code>RGB</code> format which is <code>rgb(102,102,102)</code>.</p>
  
  <p>The <em>Second</em> statement is showing value in <code>Hex</code>  which is <code>#666666</code></p>
  
  <p>But I am manually entering the value into the second print statement which is <code>102,102,102</code>.</p>
  
  <p>Is there any way to pass the value which I got from the 1st statement (Color) into the second print statement and get result?</p>
  
  <pre><code>import org.openqa.selenium.By;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.firefox.FirefoxDriver;
  
  public class Google {
  
      public static void main(String[] args) throws Exception {
  
          WebDriver driver = new FirefoxDriver();
          driver.get("http://www.google.com/");
          String Color = driver.findElement(By.xpath("//div[@class='gb_e gb_f gb_g gb_xb']/a")).getCssValue("color");
          System.out.println(Color);
          String hex = String.format("#%02x%02x%02x", 102,102,102);
          System.out.println(hex);
      }
  }
  </code></pre>