示例#1
0
 public void Add(GVColor color)
 {
     // we use Weight = -1.0 to state that this color has no explicit weight
     colorList.Enqueue(new WeightedColor {
         Weight = -GVDouble.One, Color = color
     });
 }
示例#2
0
        public void Add(GVColor color, GVDouble weight)
        {
            if (weight < GVDouble.Zero)
            {
                throw new GVException("Color-weight must be between 0.0 and 1.0");
            }
            if ((weightSum + weight) > GVDouble.One)
            {
                throw new GVException("Summed Color-weights exceed 1.0");
            }

            weightSum += weight;
            colorList.Enqueue(new WeightedColor {
                Weight = weight, Color = color
            });
        }