From: <ha...@us...> - 2013-11-10 18:51:34
|
Revision: 18938 http://sourceforge.net/p/jmol/code/18938 Author: hansonr Date: 2013-11-10 18:51:29 +0000 (Sun, 10 Nov 2013) Log Message: ----------- ___JmolVersion="13.3.9_dev_2013.11.10" new feature: new atom property: chainNo -- sequentially from 1 for each model; -- chainNo == 0 means "no chain" or chain = '<space>' new feature: set propertyColorScheme "friendly" -- color-blindness-friendly color scheme -- example: set propertyColorScheme "friendly" color {chainNo > 0} property chainNo Modified Paths: -------------- trunk/Jmol/src/org/jmol/modelset/Atom.java trunk/Jmol/src/org/jmol/modelset/Chain.java trunk/Jmol/src/org/jmol/modelset/LabelToken.java trunk/Jmol/src/org/jmol/modelset/ModelLoader.java trunk/Jmol/src/org/jmol/script/T.java trunk/Jmol/src/org/jmol/util/ColorEncoder.java trunk/Jmol/src/org/jmol/viewer/ColorManager.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties Added Paths: ----------- trunk/Jmol/src/unused/ColorUtil.java Removed Paths: ------------- trunk/Jmol/src/org/jmol/util/ColorUtil.java Modified: trunk/Jmol/src/org/jmol/modelset/Atom.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/Atom.java 2013-11-10 02:55:16 UTC (rev 18937) +++ trunk/Jmol/src/org/jmol/modelset/Atom.java 2013-11-10 18:51:29 UTC (rev 18938) @@ -1187,6 +1187,8 @@ return atom.getIndex(); case T.bondcount: return atom.getCovalentBondCount(); + case T.chainno: + return atom.group.chain.index + 1; case T.color: return atom.group.chain.model.modelSet.viewer.getColorArgbOrGray(atom.getColix()); case T.element: Modified: trunk/Jmol/src/org/jmol/modelset/Chain.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/Chain.java 2013-11-10 02:55:16 UTC (rev 18937) +++ trunk/Jmol/src/org/jmol/modelset/Chain.java 2013-11-10 18:51:29 UTC (rev 18938) @@ -29,6 +29,7 @@ public Model model; public int chainID; + public int index; public boolean isDna, isRna; int groupCount; @@ -39,9 +40,10 @@ return model.modelSet.atoms[index]; } - Chain(Model model, int chainID) { + Chain(Model model, int chainID, int index) { this.model = model; this.chainID = chainID; + this.index = index; } public Group getGroup(int groupIndex) { Modified: trunk/Jmol/src/org/jmol/modelset/LabelToken.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/LabelToken.java 2013-11-10 02:55:16 UTC (rev 18937) +++ trunk/Jmol/src/org/jmol/modelset/LabelToken.java 2013-11-10 18:51:29 UTC (rev 18938) @@ -155,7 +155,7 @@ T.volume, T.unitxyz, T.fracxyz, T.xyz, T.fuxyz, T.fux, T.fuy, T.fuz, T.hydrophobic, T.screenx, T.screeny, T.screenz, T.screenxyz, // added in 12.3.30 - T.magneticshielding, T.chemicalshift + T.magneticshielding, T.chemicalshift, T.chainno }; public LabelToken() { Modified: trunk/Jmol/src/org/jmol/modelset/ModelLoader.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/ModelLoader.java 2013-11-10 02:55:16 UTC (rev 18937) +++ trunk/Jmol/src/org/jmol/modelset/ModelLoader.java 2013-11-10 18:51:29 UTC (rev 18938) @@ -426,6 +426,7 @@ } private Group[] mergeGroups; + private int iChain; private void initializeAtomBondModelCounts(int nAtoms) { int trajectoryCount = adapterTrajectoryCount; @@ -745,12 +746,13 @@ int nRead = 0; Model[] models = modelSet.models; if (modelSet.modelCount > 0) - nullGroup = new Group().setGroup(new Chain(modelSet.models[baseModelIndex], ' '), "", + nullGroup = new Group().setGroup(new Chain(modelSet.models[baseModelIndex], 32, -1), "", 0, -1, -1); while (iterAtom.hasNext()) { nRead++; int modelIndex = iterAtom.getAtomSetIndex() + baseModelIndex; if (modelIndex != iLast) { + iChain = 0; currentModelIndex = modelIndex; currentModel = models[modelIndex]; currentChainID = Integer.MAX_VALUE; @@ -895,7 +897,7 @@ return chain; if (model.chainCount == model.chains.length) model.chains = (Chain[])AU.doubleLength(model.chains); - return model.chains[model.chainCount++] = new Chain(model, chainID); + return model.chains[model.chainCount++] = new Chain(model, chainID, (chainID == 0 || chainID == 32 ? -1 : iChain++)); } private void iterateOverAllNewBonds(JmolAdapter adapter, Modified: trunk/Jmol/src/org/jmol/script/T.java =================================================================== --- trunk/Jmol/src/org/jmol/script/T.java 2013-11-10 02:55:16 UTC (rev 18937) +++ trunk/Jmol/src/org/jmol/script/T.java 2013-11-10 18:51:29 UTC (rev 18938) @@ -582,23 +582,24 @@ public final static int bondcount = intproperty | 4; public final static int cell = intproperty | 5; public final static int centroid = intproperty | 6; - public final static int configuration = intproperty | 6 | scriptCommand; + public final static int chainno = intproperty | 7; + public final static int configuration = intproperty | 8 | scriptCommand; //color: see xxx(a, b, c, d) - public final static int elemisono = intproperty | 7; - public final static int elemno = intproperty | 8 | settable; + public final static int elemisono = intproperty | 9; + public final static int elemno = intproperty | 10 | settable; //file: see xxx(a) - public final static int formalcharge = intproperty | 9 | setparam | settable; - public final static int groupid = intproperty | 10; - public final static int groupindex = intproperty | 11; - public final static int model = intproperty | 12 | scriptCommand; - public final static int modelindex = intproperty | 13; - public final static int molecule = intproperty | 14; - public final static int polymer = intproperty | 15; - public final static int polymerlength = intproperty | 16; - public final static int resno = intproperty | 17; - public final static int site = intproperty | 18; - public final static int strucno = intproperty | 19; - public final static int valence = intproperty | 20 | settable; + public final static int formalcharge = intproperty | 11 | setparam | settable; + public final static int groupid = intproperty | 12; + public final static int groupindex = intproperty | 13; + public final static int model = intproperty | 14 | scriptCommand; + public final static int modelindex = intproperty | 15; + public final static int molecule = intproperty | 16; + public final static int polymer = intproperty | 17; + public final static int polymerlength = intproperty | 18; + public final static int resno = intproperty | 19; + public final static int site = intproperty | 20; + public final static int strucno = intproperty | 21; + public final static int valence = intproperty | 22 | settable; // float values must be multiplied by 100 prior to comparing to integer values @@ -1811,6 +1812,7 @@ "cell", T.t(cell), "chain", T.t(chain), "chains", null, + "chainNo", T.t(chainno), "chemicalShift", T.t(chemicalshift), "cs", null, "clash", T.t(clash), Modified: trunk/Jmol/src/org/jmol/util/ColorEncoder.java =================================================================== --- trunk/Jmol/src/org/jmol/util/ColorEncoder.java 2013-11-10 02:55:16 UTC (rev 18937) +++ trunk/Jmol/src/org/jmol/util/ColorEncoder.java 2013-11-10 18:51:29 UTC (rev 18938) @@ -92,16 +92,17 @@ public final static int HIGH = 9; public final static int BW = 10; public final static int WB = 11; - public final static int USER = -12; - public final static int RESU = -13; - public final static int INHERIT = 14; - public final static int ALT = 15; // == 0 + public final static int FRIENDLY = 12; // color-blind friendly + public final static int USER = -13; + public final static int RESU = -14; + public final static int INHERIT = 15; + public final static int ALT = 16; // == 0 private final static String[] colorSchemes = { "roygb", "bgyor", BYELEMENT_JMOL, BYELEMENT_RASMOL, BYRESIDUE_SHAPELY, BYRESIDUE_AMINO, - "rwb", "bwr", "low", "high", "bw", "wb", + "rwb", "bwr", "low", "high", "bw", "wb", "friendly", // custom "user", "resu", "inherit", // ALT_NAMES: @@ -126,6 +127,7 @@ // these are only implemented in the MASTER colorEncoder private int[] paletteBW; private int[] paletteWB; + private int[] paletteFriendly; private int[] argbsCpk; private int[] argbsRoygb; private int[] argbsRwb; @@ -170,6 +172,9 @@ int iScheme = createColorScheme(name, false, isOverloaded); if (isOverloaded) switch (iScheme) { + case FRIENDLY: + paletteFriendly = getPaletteAC(); + break; case BW: paletteBW = getPaletteBW(); break; @@ -356,6 +361,8 @@ for (int i = b.length, j = a.length; --i >= 0 && --j >= 0;) b[i] = a[j--]; return b; + case FRIENDLY: + return getPaletteAC(); case BW: return getPaletteBW(); case WB: @@ -401,6 +408,9 @@ switch (palette) { case CUSTOM: return thisScale.length; + case FRIENDLY: + getPaletteAC(); + return propertyColorEncoder.paletteFriendly.length; case BW: case WB: getPaletteBW(); @@ -441,6 +451,8 @@ hi = thisScale.length; } return thisScale[quantize(val, lo, hi, n)]; + case FRIENDLY: + return getPaletteAC()[quantize(val, lo, hi, n)]; case BW: return getPaletteBW()[quantize(val, lo, hi, n)]; case WB: @@ -584,6 +596,13 @@ return rasmolScale; } + private int[] getPaletteAC() { + return (propertyColorEncoder.paletteFriendly == null ? propertyColorEncoder.paletteFriendly = new int[] { 0x808080, 0x104BA9, 0xAA00A2, + 0xC9F600, 0xFFA200, 0x284A7E, 0x7F207B, 0x9FB82E, 0xBF8B30, 0x052D6E, + 0x6E0069, 0x83A000, 0xA66A00, 0x447BD4, 0xD435CD, 0xD8FA3F, 0xFFBA40, + 0x6A93D4, 0xD460CF, 0xE1FA71, 0xFFCC73 } : propertyColorEncoder.paletteFriendly); + } + private int[] getPaletteWB() { if (propertyColorEncoder.paletteWB != null) return propertyColorEncoder.paletteWB; Deleted: trunk/Jmol/src/org/jmol/util/ColorUtil.java =================================================================== --- trunk/Jmol/src/org/jmol/util/ColorUtil.java 2013-11-10 02:55:16 UTC (rev 18937) +++ trunk/Jmol/src/org/jmol/util/ColorUtil.java 2013-11-10 18:51:29 UTC (rev 18938) @@ -1,484 +0,0 @@ -/* $RCSfile$ - * $Author: nicove $ - * $Date: 2007-03-25 06:09:49 -0500 (Sun, 25 Mar 2007) $ - * $Revision: 7221 $ - * - * Copyright (C) 2000-2005 The Jmol Development Team - * - * Contact: jmo...@li... - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.jmol.util; - -//import java.util.Hashtable; -//import java.util.Map; -// -//import javajs.util.P3; -//import javajs.util.ParserJS; -//import javajs.util.T3; - - - -public class ColorUtil { -// -// private final static String[] colorNames = { -// "black", // 000000 -// "pewhite", // ffffff -// "pecyan", // 00ffff -// "pepurple", // d020ff -// "pegreen", // 00ff00 -// "peblue", // 6060ff -// "peviolet", // ff80c0 -// "pebrown", // a42028 -// "pepink", // ffd8d8 -// "peyellow", // ffff00 -// "pedarkgreen", // 00c000 -// "peorange", // ffb000 -// "pelightblue", // b0b0ff -// "pedarkcyan", // 00a0a0 -// "pedarkgray", // 606060 -// -// "aliceblue", // F0F8FF -// "antiquewhite", // FAEBD7 -// "aqua", // 00FFFF -// "aquamarine", // 7FFFD4 -// "azure", // F0FFFF -// "beige", // F5F5DC -// "bisque", // FFE4C4 -// "blanchedalmond", // FFEBCD -// "blue", // 0000FF -// "blueviolet", // 8A2BE2 -// "brown", // A52A2A -// "burlywood", // DEB887 -// "cadetblue", // 5F9EA0 -// "chartreuse", // 7FFF00 -// "chocolate", // D2691E -// "coral", // FF7F50 -// "cornflowerblue", // 6495ED -// "cornsilk", // FFF8DC -// "crimson", // DC143C -// "cyan", // 00FFFF -// "darkblue", // 00008B -// "darkcyan", // 008B8B -// "darkgoldenrod", // B8860B -// "darkgray", // A9A9A9 -// "darkgreen", // 006400 -// "darkkhaki", // BDB76B -// "darkmagenta", // 8B008B -// "darkolivegreen", // 556B2F -// "darkorange", // FF8C00 -// "darkorchid", // 9932CC -// "darkred", // 8B0000 -// "darksalmon", // E9967A -// "darkseagreen", // 8FBC8F -// "darkslateblue", // 483D8B -// "darkslategray", // 2F4F4F -// "darkturquoise", // 00CED1 -// "darkviolet", // 9400D3 -// "deeppink", // FF1493 -// "deepskyblue", // 00BFFF -// "dimgray", // 696969 -// "dodgerblue", // 1E90FF -// "firebrick", // B22222 -// "floralwhite", // FFFAF0 16775920 -// "forestgreen", // 228B22 -// "fuchsia", // FF00FF -// "gainsboro", // DCDCDC -// "ghostwhite", // F8F8FF -// "gold", // FFD700 -// "goldenrod", // DAA520 -// "gray", // 808080 -// "green", // 008000 -// "greenyellow", // ADFF2F -// "honeydew", // F0FFF0 -// "hotpink", // FF69B4 -// "indianred", // CD5C5C -// "indigo", // 4B0082 -// "ivory", // FFFFF0 -// "khaki", // F0E68C -// "lavender", // E6E6FA -// "lavenderblush", // FFF0F5 -// "lawngreen", // 7CFC00 -// "lemonchiffon", // FFFACD -// "lightblue", // ADD8E6 -// "lightcoral", // F08080 -// "lightcyan", // E0FFFF -// "lightgoldenrodyellow", // FAFAD2 -// "lightgreen", // 90EE90 -// "lightgrey", // D3D3D3 -// "lightpink", // FFB6C1 -// "lightsalmon", // FFA07A -// "lightseagreen", // 20B2AA -// "lightskyblue", // 87CEFA -// "lightslategray", // 778899 -// "lightsteelblue", // B0C4DE -// "lightyellow", // FFFFE0 -// "lime", // 00FF00 -// "limegreen", // 32CD32 -// "linen", // FAF0E6 -// "magenta", // FF00FF -// "maroon", // 800000 -// "mediumaquamarine", // 66CDAA -// "mediumblue", // 0000CD -// "mediumorchid", // BA55D3 -// "mediumpurple", // 9370DB -// "mediumseagreen", // 3CB371 -// "mediumslateblue", // 7B68EE -// "mediumspringgreen", // 00FA9A -// "mediumturquoise", // 48D1CC -// "mediumvioletred", // C71585 -// "midnightblue", // 191970 -// "mintcream", // F5FFFA -// "mistyrose", // FFE4E1 -// "moccasin", // FFE4B5 -// "navajowhite", // FFDEAD -// "navy", // 000080 -// "oldlace", // FDF5E6 -// "olive", // 808000 -// "olivedrab", // 6B8E23 -// "orange", // FFA500 -// "orangered", // FF4500 -// "orchid", // DA70D6 -// "palegoldenrod", // EEE8AA -// "palegreen", // 98FB98 -// "paleturquoise", // AFEEEE -// "palevioletred", // DB7093 -// "papayawhip", // FFEFD5 -// "peachpuff", // FFDAB9 -// "peru", // CD853F -// "pink", // FFC0CB -// "plum", // DDA0DD -// "powderblue", // B0E0E6 -// "purple", // 800080 -// "red", // FF0000 -// "rosybrown", // BC8F8F -// "royalblue", // 4169E1 -// "saddlebrown", // 8B4513 -// "salmon", // FA8072 -// "sandybrown", // F4A460 -// "seagreen", // 2E8B57 -// "seashell", // FFF5EE -// "sienna", // A0522D -// "silver", // C0C0C0 -// "skyblue", // 87CEEB -// "slateblue", // 6A5ACD -// "slategray", // 708090 -// "snow", // FFFAFA 16775930 -// "springgreen", // 00FF7F -// "steelblue", // 4682B4 -// "tan", // D2B48C -// "teal", // 008080 -// "thistle", // D8BFD8 -// "tomato", // FF6347 -// "turquoise", // 40E0D0 -// "violet", // EE82EE -// "wheat", // F5DEB3 -// "white", // FFFFFF 16777215 -// "whitesmoke", // F5F5F5 -// "yellow", // FFFF00 -// "yellowgreen", // 9ACD32 -// // plus a few rasmol names/values -// "bluetint", // AFD7FF -// "greenblue", // 2E8B57 -// "greentint", // 98FFB3 -// "grey", // 808080 -// "pinktint", // FFABBB -// "redorange", // FF4500 -// "yellowtint", // F6F675 -// }; -// -// private final static int[] colorArgbs = { -// //#FFFFC3 hover -// 0xFF000000, // black -// // plus the PE chain colors -// 0xFFffffff, // pewhite -// 0xFF00ffff, // pecyan -// 0xFFd020ff, // pepurple -// 0xFF00ff00, // pegreen -// 0xFF6060ff, // peblue -// 0xFFff80c0, // peviolet -// 0xFFa42028, // pebrown -// 0xFFffd8d8, // pepink -// 0xFFffff00, // peyellow -// 0xFF00c000, // pedarkgreen -// 0xFFffb000, // peorange -// 0xFFb0b0ff, // pelightblue -// 0xFF00a0a0, // pedarkcyan -// 0xFF606060, // pedarkgray -// // standard JavaScript -// 0xFFF0F8FF, // aliceblue -// 0xFFFAEBD7, // antiquewhite -// 0xFF00FFFF, // aqua -// 0xFF7FFFD4, // aquamarine -// 0xFFF0FFFF, // azure -// 0xFFF5F5DC, // beige -// 0xFFFFE4C4, // bisque -// 0xFFFFEBCD, // blanchedalmond -// 0xFF0000FF, // blue -// 0xFF8A2BE2, // blueviolet -// 0xFFA52A2A, // brown -// 0xFFDEB887, // burlywood -// 0xFF5F9EA0, // cadetblue -// 0xFF7FFF00, // chartreuse -// 0xFFD2691E, // chocolate -// 0xFFFF7F50, // coral -// 0xFF6495ED, // cornflowerblue -// 0xFFFFF8DC, // cornsilk -// 0xFFDC143C, // crimson -// 0xFF00FFFF, // cyan -// 0xFF00008B, // darkblue -// 0xFF008B8B, // darkcyan -// 0xFFB8860B, // darkgoldenrod -// 0xFFA9A9A9, // darkgray -// 0xFF006400, // darkgreen -// -// 0xFFBDB76B, // darkkhaki -// 0xFF8B008B, // darkmagenta -// 0xFF556B2F, // darkolivegreen -// 0xFFFF8C00, // darkorange -// 0xFF9932CC, // darkorchid -// 0xFF8B0000, // darkred -// 0xFFE9967A, // darksalmon -// 0xFF8FBC8F, // darkseagreen -// 0xFF483D8B, // darkslateblue -// 0xFF2F4F4F, // darkslategray -// 0xFF00CED1, // darkturquoise -// 0xFF9400D3, // darkviolet -// 0xFFFF1493, // deeppink -// 0xFF00BFFF, // deepskyblue -// 0xFF696969, // dimgray -// 0xFF1E90FF, // dodgerblue -// 0xFFB22222, // firebrick -// 0xFFFFFAF0, // floralwhite -// 0xFF228B22, // forestgreen -// 0xFFFF00FF, // fuchsia -// 0xFFDCDCDC, // gainsboro -// 0xFFF8F8FF, // ghostwhite -// 0xFFFFD700, // gold -// 0xFFDAA520, // goldenrod -// 0xFF808080, // gray -// 0xFF008000, // green -// 0xFFADFF2F, // greenyellow -// 0xFFF0FFF0, // honeydew -// 0xFFFF69B4, // hotpink -// 0xFFCD5C5C, // indianred -// 0xFF4B0082, // indigo -// 0xFFFFFFF0, // ivory -// 0xFFF0E68C, // khaki -// 0xFFE6E6FA, // lavender -// 0xFFFFF0F5, // lavenderblush -// 0xFF7CFC00, // lawngreen -// 0xFFFFFACD, // lemonchiffon -// 0xFFADD8E6, // lightblue -// 0xFFF08080, // lightcoral -// 0xFFE0FFFF, // lightcyan -// 0xFFFAFAD2, // lightgoldenrodyellow -// 0xFF90EE90, // lightgreen -// 0xFFD3D3D3, // lightgrey -// 0xFFFFB6C1, // lightpink -// 0xFFFFA07A, // lightsalmon -// 0xFF20B2AA, // lightseagreen -// 0xFF87CEFA, // lightskyblue -// 0xFF778899, // lightslategray -// 0xFFB0C4DE, // lightsteelblue -// 0xFFFFFFE0, // lightyellow -// 0xFF00FF00, // lime -// 0xFF32CD32, // limegreen -// 0xFFFAF0E6, // linen -// 0xFFFF00FF, // magenta -// 0xFF800000, // maroon -// 0xFF66CDAA, // mediumaquamarine -// 0xFF0000CD, // mediumblue -// 0xFFBA55D3, // mediumorchid -// 0xFF9370DB, // mediumpurple -// 0xFF3CB371, // mediumseagreen -// 0xFF7B68EE, // mediumslateblue -// 0xFF00FA9A, // mediumspringgreen -// 0xFF48D1CC, // mediumturquoise -// 0xFFC71585, // mediumvioletred -// 0xFF191970, // midnightblue -// 0xFFF5FFFA, // mintcream -// 0xFFFFE4E1, // mistyrose -// 0xFFFFE4B5, // moccasin -// 0xFFFFDEAD, // navajowhite -// 0xFF000080, // navy -// 0xFFFDF5E6, // oldlace -// 0xFF808000, // olive -// 0xFF6B8E23, // olivedrab -// 0xFFFFA500, // orange -// 0xFFFF4500, // orangered -// 0xFFDA70D6, // orchid -// 0xFFEEE8AA, // palegoldenrod -// 0xFF98FB98, // palegreen -// 0xFFAFEEEE, // paleturquoise -// 0xFFDB7093, // palevioletred -// 0xFFFFEFD5, // papayawhip -// 0xFFFFDAB9, // peachpuff -// 0xFFCD853F, // peru -// 0xFFFFC0CB, // pink -// 0xFFDDA0DD, // plum -// 0xFFB0E0E6, // powderblue -// 0xFF800080, // purple -// 0xFFFF0000, // red -// 0xFFBC8F8F, // rosybrown -// 0xFF4169E1, // royalblue -// 0xFF8B4513, // saddlebrown -// 0xFFFA8072, // salmon -// 0xFFF4A460, // sandybrown -// 0xFF2E8B57, // seagreen -// 0xFFFFF5EE, // seashell -// 0xFFA0522D, // sienna -// 0xFFC0C0C0, // silver -// 0xFF87CEEB, // skyblue -// 0xFF6A5ACD, // slateblue -// 0xFF708090, // slategray -// 0xFFFFFAFA, // snow -// 0xFF00FF7F, // springgreen -// 0xFF4682B4, // steelblue -// 0xFFD2B48C, // tan -// 0xFF008080, // teal -// 0xFFD8BFD8, // thistle -// 0xFFFF6347, // tomato -// 0xFF40E0D0, // turquoise -// 0xFFEE82EE, // violet -// 0xFFF5DEB3, // wheat -// 0xFFFFFFFF, // white -// 0xFFF5F5F5, // whitesmoke -// 0xFFFFFF00, // yellow -// 0xFF9ACD32, // yellowgreen -// // plus a few rasmol names/values -// 0xFFAFD7FF, // bluetint -// 0xFF2E8B57, // greenblue -// 0xFF98FFB3, // greentint -// 0xFF808080, // grey -// 0xFFFFABBB, // pinktint -// 0xFFFF4500, // redorange -// 0xFFF6F675, // yellowtint -// }; -// -// private static final Map<String, Integer> mapJavaScriptColors = new Hashtable<String, Integer>(); -// -// static { -// for (int i = colorNames.length; --i >= 0; ) -// mapJavaScriptColors.put(colorNames[i], Integer.valueOf(colorArgbs[i])); -// } -// -// /** -// * accepts [xRRGGBB] or [0xRRGGBB] or [0xFFRRGGBB] or #RRGGBB or -// * [red,green,blue] or a valid JavaScript color -// * -// * @param strColor -// * @return 0 if invalid or integer color -// */ -// public static int getArgbFromString(String strColor) { -// int len = 0; -// if (strColor == null || (len = strColor.length()) == 0) -// return 0; -// if (strColor.charAt(0) == '[' && strColor.charAt(len - 1) == ']') { -// String check; -// if (strColor.indexOf(",") >= 0) { -// String[] tokens = ParserJS.split(strColor.substring(1, strColor -// .length() - 1), ","); -// if (tokens.length != 3) -// return 0; -// float red = ParserJS.parseFloat(tokens[0]); -// float grn = ParserJS.parseFloat(tokens[1]); -// float blu = ParserJS.parseFloat(tokens[2]); -// return colorTriadToInt(red, grn, blu); -// } -// switch (len) { -// case 9: -// check = "x"; -// break; -// case 10: -// check = "0x"; -// break; -// default: -// return 0; -// } -// if (strColor.indexOf(check) != 1) -// return 0; -// strColor = "#" + strColor.substring(len - 7, len - 1); -// len = 7; -// } -// if (len == 7 && strColor.charAt(0) == '#') { -// try { -// return ParserJS.parseIntRadix(strColor.substring(1, 7), 16) | 0xFF000000; -// } catch (Exception e) { -// return 0; -// } -// } -// Integer boxedArgb = mapJavaScriptColors.get(strColor.toLowerCase()); -// return (boxedArgb == null ? 0 : boxedArgb.intValue()); -// } -// -// public static int colorTriadToInt(float x, float y, float z) { -// if (x <= 1 && y <= 1 && z <= 1) { -// if (x > 0) -// x = x * 256 - 1; -// if (y > 0) -// y = y * 256 - 1; -// if (z > 0) -// z = z * 256 - 1; -// } -// return rgb((int) x, (int) y, (int) z); -// } -// -// public static int rgb(int red, int grn, int blu) { -// return 0xFF000000 | (red << 16) | (grn << 8) | blu; -// } -// -// public final static P3 colorPointFromString(String colorName, P3 pt) { -// return colorPointFromInt(getArgbFromString(colorName), pt); -// } -// -// public final static P3 colorPointFromInt2(int color) { -// return P3.new3((color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF); -// } -// -// public static int colorPtToInt(T3 pt) { -// return colorTriadToInt(pt.x, pt.y, pt.z); -// } -// -// public final static P3 colorPointFromInt(int color, P3 pt) { -// pt.z = color & 0xFF; -// pt.y = (color >> 8) & 0xFF; -// pt.x = (color >> 16) & 0xFF; -// return pt; -// } -// -// /** -// * Return a greyscale rgb value 0-FF using NTSC color luminance algorithm -// *<p> -// * the alpha component is set to 0xFF. If you want a value in the -// * range 0-255 then & the result with 0xFF; -// * -// * @param rgb the rgb value -// * @return a grayscale value in the range 0 - 255 decimal -// */ -// public static int calcGreyscaleRgbFromRgb(int rgb) { -// int grey = (((2989 * ((rgb >> 16) & 0xFF)) + -// (5870 * ((rgb >> 8) & 0xFF)) + -// (1140 * (rgb & 0xFF)) + 5000) / 10000) & 0xFFFFFF; -// return rgb(grey, grey, grey); -// } -// -// public static short getBgContrast(int argb) { -// return ((calcGreyscaleRgbFromRgb(argb) & 0xFF) < 128 ? C.WHITE -// : C.BLACK); -// } - -} Modified: trunk/Jmol/src/org/jmol/viewer/ColorManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/ColorManager.java 2013-11-10 02:55:16 UTC (rev 18937) +++ trunk/Jmol/src/org/jmol/viewer/ColorManager.java 2013-11-10 18:51:29 UTC (rev 18938) @@ -250,12 +250,7 @@ break; case StaticConstants.PALETTE_CHAIN: int chain = atom.getChainID(); - if (chain < 0) - chain = 0; - else if (chain >= 256) - chain -= 256; - chain &= 0x1F; - chain = chain % JC.argbsChainAtom.length; + chain = ((chain < 0 ? 0 : chain >= 256 ? chain - 256 : chain) & 0x1F) % JC.argbsChainAtom.length; argb = (atom.isHetero() ? JC.argbsChainHetero : JC.argbsChainAtom)[chain]; break; } Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2013-11-10 02:55:16 UTC (rev 18937) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2013-11-10 18:51:29 UTC (rev 18938) @@ -11,10 +11,20 @@ # The quotes above look odd for a parameter file, but they are # important for the JavaScript version of Jmol. -___JmolVersion="13.3.9" -JmolVersion="13.3.9_dev_2013.11.09" +___JmolVersion="13.3.9_dev_2013.11.10" +new feature: new atom property: chainNo + -- sequentially from 1 for each model; + -- chainNo == 0 means "no chain" or chain = '<space>' + +new feature: set propertyColorScheme "friendly" + -- color-blindness-friendly color scheme + -- example: + + set propertyColorScheme "friendly" + color {chainNo > 0} property chainNo + bug fix: JavaScript J2S compiler error does not coerce int += float to integer bug fix: MOL reader fix for multiple-model file (just 13.3.9_dev) bug fix: JavaScript WEBGL option broken Copied: trunk/Jmol/src/unused/ColorUtil.java (from rev 18913, trunk/Jmol/src/org/jmol/util/ColorUtil.java) =================================================================== --- trunk/Jmol/src/unused/ColorUtil.java (rev 0) +++ trunk/Jmol/src/unused/ColorUtil.java 2013-11-10 18:51:29 UTC (rev 18938) @@ -0,0 +1,484 @@ +/* $RCSfile$ + * $Author: nicove $ + * $Date: 2007-03-25 06:09:49 -0500 (Sun, 25 Mar 2007) $ + * $Revision: 7221 $ + * + * Copyright (C) 2000-2005 The Jmol Development Team + * + * Contact: jmo...@li... + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package unused; + +//import java.util.Hashtable; +//import java.util.Map; +// +//import javajs.util.P3; +//import javajs.util.ParserJS; +//import javajs.util.T3; + + + +public class ColorUtil { +// +// private final static String[] colorNames = { +// "black", // 000000 +// "pewhite", // ffffff +// "pecyan", // 00ffff +// "pepurple", // d020ff +// "pegreen", // 00ff00 +// "peblue", // 6060ff +// "peviolet", // ff80c0 +// "pebrown", // a42028 +// "pepink", // ffd8d8 +// "peyellow", // ffff00 +// "pedarkgreen", // 00c000 +// "peorange", // ffb000 +// "pelightblue", // b0b0ff +// "pedarkcyan", // 00a0a0 +// "pedarkgray", // 606060 +// +// "aliceblue", // F0F8FF +// "antiquewhite", // FAEBD7 +// "aqua", // 00FFFF +// "aquamarine", // 7FFFD4 +// "azure", // F0FFFF +// "beige", // F5F5DC +// "bisque", // FFE4C4 +// "blanchedalmond", // FFEBCD +// "blue", // 0000FF +// "blueviolet", // 8A2BE2 +// "brown", // A52A2A +// "burlywood", // DEB887 +// "cadetblue", // 5F9EA0 +// "chartreuse", // 7FFF00 +// "chocolate", // D2691E +// "coral", // FF7F50 +// "cornflowerblue", // 6495ED +// "cornsilk", // FFF8DC +// "crimson", // DC143C +// "cyan", // 00FFFF +// "darkblue", // 00008B +// "darkcyan", // 008B8B +// "darkgoldenrod", // B8860B +// "darkgray", // A9A9A9 +// "darkgreen", // 006400 +// "darkkhaki", // BDB76B +// "darkmagenta", // 8B008B +// "darkolivegreen", // 556B2F +// "darkorange", // FF8C00 +// "darkorchid", // 9932CC +// "darkred", // 8B0000 +// "darksalmon", // E9967A +// "darkseagreen", // 8FBC8F +// "darkslateblue", // 483D8B +// "darkslategray", // 2F4F4F +// "darkturquoise", // 00CED1 +// "darkviolet", // 9400D3 +// "deeppink", // FF1493 +// "deepskyblue", // 00BFFF +// "dimgray", // 696969 +// "dodgerblue", // 1E90FF +// "firebrick", // B22222 +// "floralwhite", // FFFAF0 16775920 +// "forestgreen", // 228B22 +// "fuchsia", // FF00FF +// "gainsboro", // DCDCDC +// "ghostwhite", // F8F8FF +// "gold", // FFD700 +// "goldenrod", // DAA520 +// "gray", // 808080 +// "green", // 008000 +// "greenyellow", // ADFF2F +// "honeydew", // F0FFF0 +// "hotpink", // FF69B4 +// "indianred", // CD5C5C +// "indigo", // 4B0082 +// "ivory", // FFFFF0 +// "khaki", // F0E68C +// "lavender", // E6E6FA +// "lavenderblush", // FFF0F5 +// "lawngreen", // 7CFC00 +// "lemonchiffon", // FFFACD +// "lightblue", // ADD8E6 +// "lightcoral", // F08080 +// "lightcyan", // E0FFFF +// "lightgoldenrodyellow", // FAFAD2 +// "lightgreen", // 90EE90 +// "lightgrey", // D3D3D3 +// "lightpink", // FFB6C1 +// "lightsalmon", // FFA07A +// "lightseagreen", // 20B2AA +// "lightskyblue", // 87CEFA +// "lightslategray", // 778899 +// "lightsteelblue", // B0C4DE +// "lightyellow", // FFFFE0 +// "lime", // 00FF00 +// "limegreen", // 32CD32 +// "linen", // FAF0E6 +// "magenta", // FF00FF +// "maroon", // 800000 +// "mediumaquamarine", // 66CDAA +// "mediumblue", // 0000CD +// "mediumorchid", // BA55D3 +// "mediumpurple", // 9370DB +// "mediumseagreen", // 3CB371 +// "mediumslateblue", // 7B68EE +// "mediumspringgreen", // 00FA9A +// "mediumturquoise", // 48D1CC +// "mediumvioletred", // C71585 +// "midnightblue", // 191970 +// "mintcream", // F5FFFA +// "mistyrose", // FFE4E1 +// "moccasin", // FFE4B5 +// "navajowhite", // FFDEAD +// "navy", // 000080 +// "oldlace", // FDF5E6 +// "olive", // 808000 +// "olivedrab", // 6B8E23 +// "orange", // FFA500 +// "orangered", // FF4500 +// "orchid", // DA70D6 +// "palegoldenrod", // EEE8AA +// "palegreen", // 98FB98 +// "paleturquoise", // AFEEEE +// "palevioletred", // DB7093 +// "papayawhip", // FFEFD5 +// "peachpuff", // FFDAB9 +// "peru", // CD853F +// "pink", // FFC0CB +// "plum", // DDA0DD +// "powderblue", // B0E0E6 +// "purple", // 800080 +// "red", // FF0000 +// "rosybrown", // BC8F8F +// "royalblue", // 4169E1 +// "saddlebrown", // 8B4513 +// "salmon", // FA8072 +// "sandybrown", // F4A460 +// "seagreen", // 2E8B57 +// "seashell", // FFF5EE +// "sienna", // A0522D +// "silver", // C0C0C0 +// "skyblue", // 87CEEB +// "slateblue", // 6A5ACD +// "slategray", // 708090 +// "snow", // FFFAFA 16775930 +// "springgreen", // 00FF7F +// "steelblue", // 4682B4 +// "tan", // D2B48C +// "teal", // 008080 +// "thistle", // D8BFD8 +// "tomato", // FF6347 +// "turquoise", // 40E0D0 +// "violet", // EE82EE +// "wheat", // F5DEB3 +// "white", // FFFFFF 16777215 +// "whitesmoke", // F5F5F5 +// "yellow", // FFFF00 +// "yellowgreen", // 9ACD32 +// // plus a few rasmol names/values +// "bluetint", // AFD7FF +// "greenblue", // 2E8B57 +// "greentint", // 98FFB3 +// "grey", // 808080 +// "pinktint", // FFABBB +// "redorange", // FF4500 +// "yellowtint", // F6F675 +// }; +// +// private final static int[] colorArgbs = { +// //#FFFFC3 hover +// 0xFF000000, // black +// // plus the PE chain colors +// 0xFFffffff, // pewhite +// 0xFF00ffff, // pecyan +// 0xFFd020ff, // pepurple +// 0xFF00ff00, // pegreen +// 0xFF6060ff, // peblue +// 0xFFff80c0, // peviolet +// 0xFFa42028, // pebrown +// 0xFFffd8d8, // pepink +// 0xFFffff00, // peyellow +// 0xFF00c000, // pedarkgreen +// 0xFFffb000, // peorange +// 0xFFb0b0ff, // pelightblue +// 0xFF00a0a0, // pedarkcyan +// 0xFF606060, // pedarkgray +// // standard JavaScript +// 0xFFF0F8FF, // aliceblue +// 0xFFFAEBD7, // antiquewhite +// 0xFF00FFFF, // aqua +// 0xFF7FFFD4, // aquamarine +// 0xFFF0FFFF, // azure +// 0xFFF5F5DC, // beige +// 0xFFFFE4C4, // bisque +// 0xFFFFEBCD, // blanchedalmond +// 0xFF0000FF, // blue +// 0xFF8A2BE2, // blueviolet +// 0xFFA52A2A, // brown +// 0xFFDEB887, // burlywood +// 0xFF5F9EA0, // cadetblue +// 0xFF7FFF00, // chartreuse +// 0xFFD2691E, // chocolate +// 0xFFFF7F50, // coral +// 0xFF6495ED, // cornflowerblue +// 0xFFFFF8DC, // cornsilk +// 0xFFDC143C, // crimson +// 0xFF00FFFF, // cyan +// 0xFF00008B, // darkblue +// 0xFF008B8B, // darkcyan +// 0xFFB8860B, // darkgoldenrod +// 0xFFA9A9A9, // darkgray +// 0xFF006400, // darkgreen +// +// 0xFFBDB76B, // darkkhaki +// 0xFF8B008B, // darkmagenta +// 0xFF556B2F, // darkolivegreen +// 0xFFFF8C00, // darkorange +// 0xFF9932CC, // darkorchid +// 0xFF8B0000, // darkred +// 0xFFE9967A, // darksalmon +// 0xFF8FBC8F, // darkseagreen +// 0xFF483D8B, // darkslateblue +// 0xFF2F4F4F, // darkslategray +// 0xFF00CED1, // darkturquoise +// 0xFF9400D3, // darkviolet +// 0xFFFF1493, // deeppink +// 0xFF00BFFF, // deepskyblue +// 0xFF696969, // dimgray +// 0xFF1E90FF, // dodgerblue +// 0xFFB22222, // firebrick +// 0xFFFFFAF0, // floralwhite +// 0xFF228B22, // forestgreen +// 0xFFFF00FF, // fuchsia +// 0xFFDCDCDC, // gainsboro +// 0xFFF8F8FF, // ghostwhite +// 0xFFFFD700, // gold +// 0xFFDAA520, // goldenrod +// 0xFF808080, // gray +// 0xFF008000, // green +// 0xFFADFF2F, // greenyellow +// 0xFFF0FFF0, // honeydew +// 0xFFFF69B4, // hotpink +// 0xFFCD5C5C, // indianred +// 0xFF4B0082, // indigo +// 0xFFFFFFF0, // ivory +// 0xFFF0E68C, // khaki +// 0xFFE6E6FA, // lavender +// 0xFFFFF0F5, // lavenderblush +// 0xFF7CFC00, // lawngreen +// 0xFFFFFACD, // lemonchiffon +// 0xFFADD8E6, // lightblue +// 0xFFF08080, // lightcoral +// 0xFFE0FFFF, // lightcyan +// 0xFFFAFAD2, // lightgoldenrodyellow +// 0xFF90EE90, // lightgreen +// 0xFFD3D3D3, // lightgrey +// 0xFFFFB6C1, // lightpink +// 0xFFFFA07A, // lightsalmon +// 0xFF20B2AA, // lightseagreen +// 0xFF87CEFA, // lightskyblue +// 0xFF778899, // lightslategray +// 0xFFB0C4DE, // lightsteelblue +// 0xFFFFFFE0, // lightyellow +// 0xFF00FF00, // lime +// 0xFF32CD32, // limegreen +// 0xFFFAF0E6, // linen +// 0xFFFF00FF, // magenta +// 0xFF800000, // maroon +// 0xFF66CDAA, // mediumaquamarine +// 0xFF0000CD, // mediumblue +// 0xFFBA55D3, // mediumorchid +// 0xFF9370DB, // mediumpurple +// 0xFF3CB371, // mediumseagreen +// 0xFF7B68EE, // mediumslateblue +// 0xFF00FA9A, // mediumspringgreen +// 0xFF48D1CC, // mediumturquoise +// 0xFFC71585, // mediumvioletred +// 0xFF191970, // midnightblue +// 0xFFF5FFFA, // mintcream +// 0xFFFFE4E1, // mistyrose +// 0xFFFFE4B5, // moccasin +// 0xFFFFDEAD, // navajowhite +// 0xFF000080, // navy +// 0xFFFDF5E6, // oldlace +// 0xFF808000, // olive +// 0xFF6B8E23, // olivedrab +// 0xFFFFA500, // orange +// 0xFFFF4500, // orangered +// 0xFFDA70D6, // orchid +// 0xFFEEE8AA, // palegoldenrod +// 0xFF98FB98, // palegreen +// 0xFFAFEEEE, // paleturquoise +// 0xFFDB7093, // palevioletred +// 0xFFFFEFD5, // papayawhip +// 0xFFFFDAB9, // peachpuff +// 0xFFCD853F, // peru +// 0xFFFFC0CB, // pink +// 0xFFDDA0DD, // plum +// 0xFFB0E0E6, // powderblue +// 0xFF800080, // purple +// 0xFFFF0000, // red +// 0xFFBC8F8F, // rosybrown +// 0xFF4169E1, // royalblue +// 0xFF8B4513, // saddlebrown +// 0xFFFA8072, // salmon +// 0xFFF4A460, // sandybrown +// 0xFF2E8B57, // seagreen +// 0xFFFFF5EE, // seashell +// 0xFFA0522D, // sienna +// 0xFFC0C0C0, // silver +// 0xFF87CEEB, // skyblue +// 0xFF6A5ACD, // slateblue +// 0xFF708090, // slategray +// 0xFFFFFAFA, // snow +// 0xFF00FF7F, // springgreen +// 0xFF4682B4, // steelblue +// 0xFFD2B48C, // tan +// 0xFF008080, // teal +// 0xFFD8BFD8, // thistle +// 0xFFFF6347, // tomato +// 0xFF40E0D0, // turquoise +// 0xFFEE82EE, // violet +// 0xFFF5DEB3, // wheat +// 0xFFFFFFFF, // white +// 0xFFF5F5F5, // whitesmoke +// 0xFFFFFF00, // yellow +// 0xFF9ACD32, // yellowgreen +// // plus a few rasmol names/values +// 0xFFAFD7FF, // bluetint +// 0xFF2E8B57, // greenblue +// 0xFF98FFB3, // greentint +// 0xFF808080, // grey +// 0xFFFFABBB, // pinktint +// 0xFFFF4500, // redorange +// 0xFFF6F675, // yellowtint +// }; +// +// private static final Map<String, Integer> mapJavaScriptColors = new Hashtable<String, Integer>(); +// +// static { +// for (int i = colorNames.length; --i >= 0; ) +// mapJavaScriptColors.put(colorNames[i], Integer.valueOf(colorArgbs[i])); +// } +// +// /** +// * accepts [xRRGGBB] or [0xRRGGBB] or [0xFFRRGGBB] or #RRGGBB or +// * [red,green,blue] or a valid JavaScript color +// * +// * @param strColor +// * @return 0 if invalid or integer color +// */ +// public static int getArgbFromString(String strColor) { +// int len = 0; +// if (strColor == null || (len = strColor.length()) == 0) +// return 0; +// if (strColor.charAt(0) == '[' && strColor.charAt(len - 1) == ']') { +// String check; +// if (strColor.indexOf(",") >= 0) { +// String[] tokens = ParserJS.split(strColor.substring(1, strColor +// .length() - 1), ","); +// if (tokens.length != 3) +// return 0; +// float red = ParserJS.parseFloat(tokens[0]); +// float grn = ParserJS.parseFloat(tokens[1]); +// float blu = ParserJS.parseFloat(tokens[2]); +// return colorTriadToInt(red, grn, blu); +// } +// switch (len) { +// case 9: +// check = "x"; +// break; +// case 10: +// check = "0x"; +// break; +// default: +// return 0; +// } +// if (strColor.indexOf(check) != 1) +// return 0; +// strColor = "#" + strColor.substring(len - 7, len - 1); +// len = 7; +// } +// if (len == 7 && strColor.charAt(0) == '#') { +// try { +// return ParserJS.parseIntRadix(strColor.substring(1, 7), 16) | 0xFF000000; +// } catch (Exception e) { +// return 0; +// } +// } +// Integer boxedArgb = mapJavaScriptColors.get(strColor.toLowerCase()); +// return (boxedArgb == null ? 0 : boxedArgb.intValue()); +// } +// +// public static int colorTriadToInt(float x, float y, float z) { +// if (x <= 1 && y <= 1 && z <= 1) { +// if (x > 0) +// x = x * 256 - 1; +// if (y > 0) +// y = y * 256 - 1; +// if (z > 0) +// z = z * 256 - 1; +// } +// return rgb((int) x, (int) y, (int) z); +// } +// +// public static int rgb(int red, int grn, int blu) { +// return 0xFF000000 | (red << 16) | (grn << 8) | blu; +// } +// +// public final static P3 colorPointFromString(String colorName, P3 pt) { +// return colorPointFromInt(getArgbFromString(colorName), pt); +// } +// +// public final static P3 colorPointFromInt2(int color) { +// return P3.new3((color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF); +// } +// +// public static int colorPtToInt(T3 pt) { +// return colorTriadToInt(pt.x, pt.y, pt.z); +// } +// +// public final static P3 colorPointFromInt(int color, P3 pt) { +// pt.z = color & 0xFF; +// pt.y = (color >> 8) & 0xFF; +// pt.x = (color >> 16) & 0xFF; +// return pt; +// } +// +// /** +// * Return a greyscale rgb value 0-FF using NTSC color luminance algorithm +// *<p> +// * the alpha component is set to 0xFF. If you want a value in the +// * range 0-255 then & the result with 0xFF; +// * +// * @param rgb the rgb value +// * @return a grayscale value in the range 0 - 255 decimal +// */ +// public static int calcGreyscaleRgbFromRgb(int rgb) { +// int grey = (((2989 * ((rgb >> 16) & 0xFF)) + +// (5870 * ((rgb >> 8) & 0xFF)) + +// (1140 * (rgb & 0xFF)) + 5000) / 10000) & 0xFFFFFF; +// return rgb(grey, grey, grey); +// } +// +// public static short getBgContrast(int argb) { +// return ((calcGreyscaleRgbFromRgb(argb) & 0xFF) < 128 ? C.WHITE +// : C.BLACK); +// } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |