In the following code I need to print the color in Hex format.
First Print statement is showing value in RGB format
The code works, but just a little typo. The Color.fromString would be upper case C
import org.openqa.selenium.support.Color;
String color = driver.findElement(By.xpath("xpath_value")).getCssValue("color");
System.out.println(color);
String hex = Color.fromString(color).asHex();
System.out.println(hex);