@ Override public Color getAtomColor ( IAtom atom , Color defaultColor ) { Color color = defaultColor ; String symbol = atom . getSymbol ( ) . toUpperCase ( ) ; if ( atom . getAtomicNumber ( ) != null && ATOM_COLORS_MASSNUM . containsKey ( atom . getAtomicNumber ( ) ) ) { color = ATOM_COLORS_MASSNUM . get ( atom . getAtomicNumber ( ) ) ; // lookup by atomic number. } else if ( ATOM_COLORS_SYMBOL . containsKey ( symbol ) ) { color = ATOM_COLORS_SYMBOL . get ( symbol ) ; // lookup by atomic symbol. } return new Color ( color . getRed ( ) , color . getGreen ( ) , color . getBlue ( ) ) ; // return atom copy. }
Returns the font color for atom given atom .