using System;
using UnityAtoms.BaseAtoms;
using UnityEngine;
namespace UnityAtoms.BaseAtoms
{
///
/// Reference of type `Color`. Inherits from `EquatableAtomReference<Color, ColorPair, ColorConstant, ColorVariable, ColorEvent, ColorPairEvent, ColorColorFunction, ColorVariableInstancer, AtomCollection, AtomList>`.
///
[Serializable]
public sealed class ColorReference : EquatableAtomReference<
Color,
ColorPair,
ColorConstant,
ColorVariable,
ColorEvent,
ColorPairEvent,
ColorColorFunction,
ColorVariableInstancer>, IEquatable
{
public ColorReference() : base() { }
public ColorReference(Color value) : base(value) { }
public bool Equals(ColorReference other) { return base.Equals(other); }
///
/// Set Alpha of Color by value.
///
/// New alpha value.
public void SetAlpha(float value) => Value = new Color(Value.r, Value.g, Value.b, value);
///
/// Set Alpha of Color by Variable value.
///
/// New alpha Variable value.
public void SetAlpha(AtomBaseVariable variable) => SetAlpha(variable.Value);
}
}