Signature changes of com.aspose.cells.Color.a()

We are using 24.6 version of aspose cells and the method com.aspose.cells.Color.a() it accepts String (color) value for ex “#151921” but now we are moving to latest aspose cells version 25.6 and found that com.aspose.cells.Color.a() is not anymore accepting String value as an input instead it requires a4.

What will be an alternative in latest version to achieve this usecase?

@VaradS ,

The method is public in 25.6: com.aspose.cells.Color.fromName(String name). The param name should be a color name, e.g. “Blue”. Your specified name “#151921” will return a color with intArgb 0.

@peyton.xu
Thanks for the reply

How can I use the “#151921” hex value as an input to aspose method to set the color to an element?
I don’t have name e.g “Blue” information to set the color. I need a method that accepts HEX value.

I tried with com.aspose.cells.Color.fromName(“#151921”) but it does not return color with intArgb 0 instead it returned “Empty color”.

@VaradS
Please parse “#151921” as the following :

public static void main(String[] args) throws Throwable {
		int rgb = Integer.parseInt("#151921".substring(1), 16); // 结果:1382273
		Color c = Color.fromArgb(rgb);
		System.out.println(c.getR());
    }