sysperfana/analyzetoolext/com.nokia.s60tools.analyzetool/src/com/nokia/s60tools/analyzetool/internal/ui/util/ColorUtil.java
changeset 1 1050670c6980
child 6 f65f740e69f9
equal deleted inserted replaced
0:5ad7ad99af01 1:1050670c6980
       
     1 /*
       
     2  * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  Definitions for the class ColorUtil
       
    15  *
       
    16  */
       
    17 package com.nokia.s60tools.analyzetool.internal.ui.util;
       
    18 
       
    19 import org.eclipse.swt.graphics.Color;
       
    20 import org.eclipse.swt.widgets.Display;
       
    21 
       
    22 /**
       
    23  * Utilities for generating the same (unique) colour for a given String every
       
    24  * time.
       
    25  */
       
    26 public final class ColorUtil
       
    27 {
       
    28 	private static final int[] RGB_WHITE = { 255, 255, 255 };
       
    29 	private static final int[] RGB_GREY  = { 180, 180, 180 };//light grey
       
    30 	private static final int[] RGB_BLACK = { 0, 0, 0 };
       
    31 	private static final int[] RGB_100 = {100, 100, 100};//middle grey
       
    32 	private static final int[] RGB_170 = {170, 170, 170};//light grey
       
    33 	private static final int[] RGB_200 = {200, 200, 200};//very light grey
       
    34 
       
    35 	/** Color representing the colour white */
       
    36 	public static final Color WHITE =
       
    37 		new Color(Display.getDefault(), RGB_WHITE[0], RGB_WHITE[1], RGB_WHITE[2]);
       
    38 
       
    39 	/** Color representing the colour grey */
       
    40 	public static final Color GREY =
       
    41 		new Color(Display.getDefault(), RGB_GREY[0], RGB_GREY[1], RGB_GREY[2]);
       
    42 
       
    43 	/** Color representing the colour black */
       
    44 	public static final Color BLACK =
       
    45 		new Color(Display.getDefault(), RGB_BLACK[0], RGB_BLACK[1], RGB_BLACK[2]);
       
    46 	
       
    47 	/** Color representing middle grey */
       
    48 	public static final Color COLOR_100 = new Color(Display.getDefault(), RGB_100[0], RGB_100[1], RGB_100[2]);
       
    49 	/** Color representing very light grey */
       
    50 	public static final Color COLOR_200 = new Color(Display.getDefault(), RGB_200[0], RGB_200[1], RGB_200[2]);
       
    51 	/** Color representing light grey */
       
    52 	public static final Color COLOR_170 = new Color(Display.getDefault(), RGB_170[0], RGB_170[1], RGB_170[2]);
       
    53 	
       
    54 	// Guard against instantiation
       
    55 	private ColorUtil() {}
       
    56 }