1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.utils.ui.color;
\r
18 * @author Marko Luukkainen
\r
21 public class ColorValue {
\r
22 private Color color;
\r
23 private double value;
\r
26 public ColorValue() {
\r
30 public ColorValue(Color color, double value) {
\r
35 public Color getColor() {
\r
39 public double getValue() {
\r
44 public int hashCode() {
\r
45 return color.hashCode() ^ new Double(value).hashCode();
\r
49 public boolean equals(Object obj) {
\r
50 if (!(obj instanceof ColorValue))
\r
52 ColorValue cv = (ColorValue) obj;
\r
53 if (cv.value != value) return false;
\r
54 if (!cv.color.equals(color)) return false;
\r