1 package org.simantics.scl.ui.editor;
3 import java.util.HashMap;
5 import org.eclipse.swt.graphics.Color;
6 import org.eclipse.swt.graphics.RGB;
7 import org.eclipse.swt.widgets.Display;
9 public class ColorManager {
11 protected HashMap<RGB, Color> colorTable = new HashMap<RGB, Color>();
13 public void dispose() {
14 for(Color c : colorTable.values())
19 public Color get(RGB rgb) {
20 Color color = colorTable.get(rgb);
22 color = new Color(Display.getCurrent(), rgb);
23 colorTable.put(rgb, color);