Changeset 9229 in josm for trunk/src/org
- Timestamp:
- 2015-12-31T13:54:58+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ColorHelper.java
r9223 r9229 82 82 public static Color getForegroundColor(Color bg) { 83 83 // http://stackoverflow.com/a/3943023/2257172 84 return (bg.getRed()*0.299 + bg.getGreen()*0.587 + bg.getBlue()*0.114) > 186 ? 85 Color.BLACK : Color.WHITE; 84 return bg == null ? null : 85 (bg.getRed()*0.299 + bg.getGreen()*0.587 + bg.getBlue()*0.114) > 186 ? 86 Color.BLACK : Color.WHITE; 86 87 } 87 88 }
Note:
See TracChangeset
for help on using the changeset viewer.