Thursday, 3 December 2009

creating Color instance from hex representation. Создание экземпляра класса Color из 16тиричного представления.

To construct Color classs instance from hex representation, for example "efff1e7" use code:

String color = "efff1e7";
int intColor = Integer.parseInt (color,16);
Color bgColor = new Color (intColor);

для создания экземпляра класса Color из 16-тиричного строкового представления используем следующий код:

String color = "efff1e7";
int intColor = Integer.parseInt (color,16);
Color bgColor = new Color (intColor);

No comments:

Post a Comment