using Artemis.Core; using RGB.NET.Core; namespace Artemis.VisualScripting.Nodes.Mathematics; [Node("Clamp", "Clamps the value to be in between min and max", "Mathematics", InputType = typeof(Numeric), OutputType = typeof(Numeric))] public class ClampNode : Node { #region Properties & Fields public InputPin Value { get; } public InputPin Min { get; } public InputPin Max { get; } public OutputPin Result { get; } #endregion #region Constructors public ClampNode() { Value = CreateInputPin("Value"); Min = CreateInputPin("Min"); Max = CreateInputPin("Max"); Result = CreateOutputPin(); } #endregion #region Methods /// public override void Evaluate() => Result.Value = ((float)Value.Value).Clamp(Min.Value, Max.Value); #endregion }