コード例 #1
0
        public void ApplyChild(ColourInfo childColour)
        {
            if (!HasSingleColour)
            {
                ApplyChild(childColour, new Quad(0, 0, 1, 1));
                return;
            }

            if (childColour.HasSingleColour)
            {
                singleColour *= childColour.singleColour;
            }
            else
            {
                HasSingleColour = false;
                BottomLeft      = childColour.BottomLeft * TopLeft;
                TopRight        = childColour.TopRight * TopLeft;
                BottomRight     = childColour.BottomRight * TopLeft;

                // Need to assign TopLeft last to keep correctness.
                TopLeft = childColour.TopLeft * TopLeft;
            }
        }
コード例 #2
0
 public SRGBColour Interpolate(Vector2 interp) => SRGBColour.FromVector(
     (1 - interp.Y) * ((1 - interp.X) * TopLeft.ToVector() + interp.X * TopRight.ToVector()) +
     interp.Y * ((1 - interp.X) * BottomLeft.ToVector() + interp.X * BottomRight.ToVector()));
コード例 #3
0
 public bool Equals(SRGBColour other) => HasSingleColour && TopLeft.Equals(other);