public BlendingAttribute(BlendingAttribute copyFrom = null) :
     this(
         copyFrom?.blended ?? true,
         copyFrom?.sourceFunction ?? BlendingFactor.SrcAlpha,
         copyFrom?.destFunction ?? BlendingFactor.OneMinusSrcAlpha,
         copyFrom?.opacity ?? 1.0f
         )
 {
 }
        public override int CompareTo(Attribute o)
        {
            if (type != o.type)
            {
                return((int)(type - o.type));
            }
            BlendingAttribute other = (BlendingAttribute)o;

            if (blended != other.blended)
            {
                return(blended ? 1 : -1);
            }
            if (sourceFunction != other.sourceFunction)
            {
                return(sourceFunction - other.sourceFunction);
            }
            if (destFunction != other.destFunction)
            {
                return(destFunction - other.destFunction);
            }
            return((MathHelper.isEqual(opacity, other.opacity)) ? 0 : (opacity < other.opacity ? 1 : -1));
        }