/// <summary>
		/// Copy construct a new <c>BaseColorCollection</c>
		/// </summary>
		/// <param name="other">The BaseColorCollection to copy</param>
		public BaseColorCollection(BaseColorCollection other) {
			if (other == null) {
				throw new ArgumentNullException("other","Cannot copy construct a null reference") ;
			}

			this.colors = (Color []) other.colors.Clone() ;
		}
Exemple #2
0
		/// <summary>
		/// Create an <c>AbstractColorPair</c> from another 
		/// <c>BaseColorCollection</c>
		/// </summary>
		/// <param name="colors">The other <c>BaseColorCollection</c></param>
		/// <remarks>
		/// Only the 1st and 2nd color are considered. If the <c>colors</c>
		/// collection only contains a single color, both color entries are
		/// equal to that value. If zero colors are specified in colors
		/// then both values are the default, <see cref="Color.Empty"/>
		/// </remarks>
		public AbstractColorPair(BaseColorCollection colors) : base(2) {
			if (colors == null) {
				throw new ArgumentNullException("colors","BaseColorCollection cannot be null") ;
			}

			if (colors.Count > 0) {
				this[AbstractColorPairType.Color1] = colors[0] ;
			}
			
			if (colors.Count > 1) {
				this[AbstractColorPairType.Color2] = colors[1] ;
			} else {
				this[AbstractColorPairType.Color2] = Color1 ;
			}
		}
Exemple #3
0
		/// <summary>
		/// Create a <c>ColorPair</c> form the specified <see cref="BaseColorCollection"/>
		/// </summary>
		/// <param name="colors">The <see cref="BaseColorCollection"/> to initialize
		/// from</param>
		/// <remarks>
		/// See <see cref="AbstractColorPair(BaseColorCollection)"/> for more
		/// details
		/// </remarks>
		public ColorPair(BaseColorCollection colors) : base(colors) {}
		/// <summary>
		/// Create a <c>GradientColor</c> from a <see cref="BaseColorCollection"/>
		/// </summary>
		/// <remarks>
		/// See <see cref="AbstractColorPair(BaseColorCollection)"/> for more information
		/// </remarks>
		public GradientColor(BaseColorCollection colors) : base(colors) {}