Skin color validation (#15140)

This commit is contained in:
Flipp Syder
2023-04-05 16:41:11 -07:00
committed by GitHub
parent 661329ab72
commit c02824a85c
3 changed files with 34 additions and 15 deletions

View File

@@ -133,6 +133,27 @@ public static class SkinColor
// tinted hues just ensures saturation is always .1, or 10% saturation at all times
return Color.ToHsv(color).Y != .1f;
}
public static bool VerifySkinColor(HumanoidSkinColor type, Color color)
{
return type switch
{
HumanoidSkinColor.HumanToned => VerifyHumanSkinTone(color),
HumanoidSkinColor.TintedHues => VerifyTintedHues(color),
HumanoidSkinColor.Hues => true,
_ => false,
};
}
public static Color ValidSkinTone(HumanoidSkinColor type, Color color)
{
return type switch
{
HumanoidSkinColor.HumanToned => ValidHumanSkinTone,
HumanoidSkinColor.TintedHues => ValidTintedHuesSkinTone(color),
_ => color
};
}
}
public enum HumanoidSkinColor : byte