java - Convert a string to a swt color -
the real problem want use color chooser (for awt color), swt component. thought awt color, .tostring on it, recover string, , convert swt color. harder expected.
here string convert :
string mycolor = "color {248, 248, 248}";
i did .tostring method on awt color.
do have idea on how ?
here sample method taken example, converts awt color
swt color
:
public static color toswtcolor(device device, java.awt.color color) { return new org.eclipse.swt.graphics.color(device, color.getred(), color.getgreen(), color.getblue()); }
Comments
Post a Comment