Skin color validation (#15140)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user