1 /*******************************************************************************
2 * Copyright (c) 2020 Association for Decentralized Information Management in
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Semantum Oy - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.scenegraph.g2d.color;
14 import java.awt.Color;
16 public class BWColorFilter implements ColorFilter {
19 public Color filter(Color c) {
20 int avg = (c.getRed() + c.getGreen() + c.getBlue()) / 3;
21 Color c2 = new Color(avg, avg, avg, c.getAlpha());
26 public int hashCode() {
27 return getClass().hashCode();
31 public boolean equals(Object obj) {
36 if (getClass() != obj.getClass())