Beispiel #1
0
    protected override Node EditColor(Color color, Number number)
    {
      var value = number.Value;

      if (number.Unit == "%")
        value = (value * 255) / 100d;

      return new Color(color.R, color.G, color.B + value);
    }
    protected override Node EditColor(Color color, Number number)
    {
      var alpha = number.Value;

      if (number.Unit == "%")
        alpha = alpha / 100d;

      return new Color(color.R, color.G, color.B, color.Alpha + alpha);
    }
    protected override Node Eval(Color color)
    {
      var grey = (color.RGB.Max() + color.RGB.Min()) / 2;

      return new Color(grey, grey, grey);
    }
    protected override Node Eval(Color color)
    {
      var hsl = HslColor.FromRgbColor(color);

      return EvalHsl(hsl);
    }
    protected override Node EditColor(Color color, Number number)
    {
      var hsl = HslColor.FromRgbColor(color);

      return EditHsl(hsl, number);
    }
Beispiel #6
0
 protected override Node Eval(Color color)
 {
   return new Number(color.B);
 }
 protected virtual Node EditColor(Color color, Number number)
 {
   return null;
 }
 protected abstract Node Eval(Color color);