SWT/Jface 怎么获取Color对象

SWT/Jface 如何获取Color对象一般在我们进行开发的时候 难免会遇到color font image等资源我希望大家定义

SWT/Jface 如何获取Color对象

一般在我们进行开发的时候 难免会遇到color font image等资源

我希望大家定义一些工具类进行管理,这样方便集中管理,也方便大家使用。

以下贴一下我写的color的工具类:

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;

public class ColorUtil {

 private static Display getDisplay(){
  
  return Display.getCurrent();
 }
 public static Color returnWhiteColor(){
  
  return getDisplay().getSystemColor(SWT.COLOR_WHITE);
 }
}