1 /*******************************************************************************
2 * Copyright (c) 2016 EfficiOS Inc., Alexandre Montplaisir
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
10 package org
.eclipse
.tracecompass
.internal
.provisional
.tmf
.core
.views
.timegraph2
;
12 import java
.util
.Objects
;
14 import org
.eclipse
.jdt
.annotation
.Nullable
;
16 public class ColorDefinition
{
18 public static final int MIN
= 0;
19 public static final int MAX
= 255;
21 public final int fRed
;
22 public final int fGreen
;
23 public final int fBlue
;
24 public final int fAlpha
;
26 public ColorDefinition(int red
, int green
, int blue
) {
27 this(red
, green
, blue
, MAX
);
30 public ColorDefinition(int red
, int green
, int blue
, int alpha
) {
42 private static void checkValue(int value
) throws IllegalArgumentException
{
43 if (value
< MIN
|| value
> MAX
) {
44 throw new IllegalArgumentException();
49 public int hashCode() {
50 return Objects
.hash(fRed
, fGreen
, fBlue
, fAlpha
);
54 public boolean equals(@Nullable Object obj
) {
61 if (getClass() != obj
.getClass()) {
64 ColorDefinition other
= (ColorDefinition
) obj
;
65 if (fAlpha
!= other
.fAlpha
||
66 fBlue
!= other
.fBlue
||
67 fGreen
!= other
.fGreen
||
This page took 0.032621 seconds and 5 git commands to generate.