public override bool Equals(Object obj) { if (!(obj == this)) { return(false); } PaintCodeGradient other = (PaintCodeGradient)obj; return(Array.Equals(this.colors, other.colors) && Array.Equals(this.positions, other.positions)); }
public SKShader get(PaintCodeGradient paintCodeGradient, float x0, float y0, float x1, float y1) { if (this.shader == null || this.x0 != x0 || this.y0 != y0 || this.x1 != x1 || this.y1 != y1 || !this.paintCodeGradient.Equals(paintCodeGradient)) { if (this.shader != null) { this.shader.Dispose(); } this.x0 = x0; this.y0 = y0; this.x1 = x1; this.y1 = y1; this.paintCodeGradient = paintCodeGradient; this.shader = paintCodeGradient.linearGradient(x0, y0, x1, y1); } return(this.shader); }