After I get the css value of the color of a WebElement using getCssValue(), I end up with a String with the following format: "rgba(105, 54, 221, 1)". I need to convert it to the Color type-of object, to be able to convert it to hex afterwards, but I get a NumberFormatException for input string: "rgba(105, 54, 221, 1)" when trying to use the Integer.parseInt method.
My code is:
String updatedColorAsString = header.getCssValue("color"); //resulting string is "rgba(105, 54, 221, 1)"
Color updatedColor = new Color(Integer.parseInt(updatedColorAsString));
I am new to Java-Selenium and I have no idea how to work with that String in order to properly convert it to rgba Color, I would really appreciate any help on this :D