예제 #1
0
        /// <summary>
        /// Determine the color of a bond, returning either the default color,
        /// the override color or whatever is in the color hash for that bond.
        /// </summary>
        /// <param name="bond">the bond we are generating an element for</param>
        /// <param name="model">the rendering model</param>
        /// <returns>the color to paint the bond</returns>
        public virtual Color GetColorForBond(IBond bond, RendererModel model)
        {
            if (this.overrideColor != null)
            {
                return(overrideColor.Value);
            }

            if (!model.GetColorHash().TryGetValue(bond, out Color color))
            {
                color = model.GetDefaultBondColor();
            }
            return(color);
        }