public IColorExpression Subtract( IColorValue term1, params IColorValue[] terms) => new ColorExpression( ListUtil.ReadonlyFrom( this, this.NegateTerms(term1, terms)));
private void PrintColorValue_( StringWriter os, IColorValue value, bool wrapExpressions = false) { if (value is IColorExpression expression) { if (wrapExpressions) { os.Write("("); } this.PrintColorExpression_(os, expression); if (wrapExpressions) { os.Write(")"); } } else if (value is IColorTerm term) { this.PrintColorTerm_(os, term); } else if (value is IColorFactor factor) { this.PrintColorFactor_(os, factor); } else { Asserts.Fail("Unsupported value type!"); } }
public IColorTerm Divide( IColorValue factor1, params IColorValue[] factors) => new ColorTerm(this.NumeratorFactors, ListUtil.ReadonlyConcat( this.DenominatorFactors, ListUtil.ReadonlyFrom(factor1, factors)));
public string Print(IColorValue colorValue) { var sb = new StringBuilder(); using var os = new StringWriter(sb); this.PrintColorValue_(os, colorValue); return(sb.ToString()); }
public ShaderLabColorReference(IColorElement colorElement, IColorPropertyValue colorPropertyValue, IColorValue colorValue, DocumentRange colorConstantRange) { myColorPropertyValue = colorPropertyValue; myColorValue = colorValue; ColorElement = colorElement; Owner = (ITreeNode)colorValue ?? colorPropertyValue; ColorConstantRange = colorConstantRange; BindOptions = new ColorBindOptions { BindsToName = false, BindsToValue = true }; }
private void widget_PointEventChanged(object sender, PointColorEvent e) { this.UpDateData(delegate { IColorValue colorValue = this._propertyItem.Instance as IColorValue; if (e.Type == 0) { this._propertyItem.SetValue("ColorAngle", (float)e.Value, null); } else { this._propertyItem.SetValue("BackColorAlpha", (int)e.Value, null); } }); }
private void widget_PointEventChanged(object sender, PointColorEvent e) { this.UpDateData((System.Action)(() => { IColorValue instance = this._propertyItem.Instance as IColorValue; if (e.Type == 0) { this._propertyItem.SetValue("ColorAngle", (object)(float)e.Value, (object[])null); } else { this._propertyItem.SetValue("BackColorAlpha", (object)(int)e.Value, (object[])null); } })); }
private void SetControl() { this.widget.SetValue((System.Action)(() => { IColorValue instance = this._propertyItem.Instance as IColorValue; System.Drawing.Color singleColor = instance.SingleColor; int comboBoxIndex = instance.ComboBoxIndex; System.Drawing.Color firstColor = instance.FirstColor; System.Drawing.Color endColor = instance.EndColor; ScaleValue colorVector = instance.ColorVector; float num = (float)this._propertyItem.Instance.GetType().GetProperty("ColorAngle").GetValue(this._propertyItem.Instance, (object[])null); this.widget.SetControl(this.ConvertColor(singleColor), comboBoxIndex, this.ConvertColor(firstColor), this.ConvertColor(endColor), (int)num); this.SetBgColor(); })); }
private void SetControl() { this.widget.SetValue(delegate { IColorValue colorValue = this._propertyItem.Instance as IColorValue; System.Drawing.Color singleColor = colorValue.SingleColor; int comboBoxIndex = colorValue.ComboBoxIndex; System.Drawing.Color firstColor = colorValue.FirstColor; System.Drawing.Color endColor = colorValue.EndColor; ScaleValue colorVector = colorValue.ColorVector; PropertyInfo property = this._propertyItem.Instance.GetType().GetProperty("ColorAngle"); float num = (float)property.GetValue(this._propertyItem.Instance, null); this.widget.SetControl(this.ConvertColor(singleColor), comboBoxIndex, this.ConvertColor(firstColor), this.ConvertColor(endColor), (int)num); this.SetBgColor(); }); }
public IColorTerm Multiply( IColorValue factor1, params IColorValue[] factors) => new ColorTerm(ListUtil.ReadonlyConcat( this.NumeratorFactors, ListUtil.ReadonlyFrom(factor1, factors)));
public IColorExpression Add( IColorValue term1, params IColorValue[] terms) => new ColorExpression(ListUtil.ReadonlyConcat(this.Terms, terms));
protected IColorValue[] NegateTerms( IColorValue term1, params IColorValue[] terms) => this.NegateTerms(ListUtil.From(term1, terms).ToArray());
public IColorTerm Divide( IColorValue factor1, params IColorValue[] factors) => new ColorTerm(ListUtil.ReadonlyFrom(this), ListUtil.ReadonlyFrom(factor1, factors));
public IColorTerm Multiply( IColorValue factor1, params IColorValue[] factors) => new ColorTerm(ListUtil.ReadonlyFrom(this, factor1, factors));
public IColorExpression Add( IColorValue term1, params IColorValue[] terms) => new ColorExpression(ListUtil.ReadonlyFrom(this, term1, terms));
public ColorOutput(TIdentifier identifier, IColorValue value) { this.Identifier = identifier; this.ColorValue = value; }