src/share/classes/java/awt/image/IndexColorModel.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -907,11 +907,11 @@
             // to one of the color components for a match
             // using a simple linear distance formula.
 
             int minDist = 256;
             int d;
-            int gray = (int) (red*77 + green*150 + blue*29 + 128)/256;
+            int gray = (red*77 + green*150 + blue*29 + 128)/256;
 
             for (int i = 0; i < map_size; i++) {
                 if (this.rgb[i] == 0x0) {
                     // For allgrayopaque colormaps, entries are 0
                     // iff they are an invalid color and should be