public DyeEffectModifier(DyeEffectDelegate effect = null, DyeModifier<Color> primaryColor = null, DyeModifier<Color> secondaryColor = null, DyeModifier<float> opacity = null, DyeModifier<float> saturation = null) { this.opacity = opacity ?? new DyeModifier<float>(1.0f); this.saturation = saturation ?? new DyeModifier<float>(1.0f); this.primaryColor = primaryColor ?? new DyeModifier<Color>((Color)default); this.secondaryColor = secondaryColor ?? new DyeModifier<Color>((Color)default); this.GetEffect = effect ?? ((instance, data, shader, entity, drawData) => { shader.UseColor(primaryColor.GetValue(data, shader, entity, drawData)); shader.UseSecondaryColor(secondaryColor.GetValue(data, shader, entity, drawData)); shader.UseOpacity(opacity.GetValue(data, shader, entity, drawData)); shader.UseSaturation(saturation.GetValue(data, shader, entity, drawData)); }); }
public override Color GetValue(CustomDyeData data, CustomShader shader, Entity entity, DrawData? drawData) => _value.GetValue(data, shader, entity, drawData);
public override Color GetValue(CustomDyeData data, CustomShader shader, Entity entity, DrawData? drawData) => new Color(_valueR.GetValue(data, shader, entity, drawData), _valueG.GetValue(data, shader, entity, drawData), _valueB.GetValue(data, shader, entity, drawData));