Example #1
0
        /**
         * Get the eye color of a Farmer or NPC
         */
        public static Color GetEyeColor(Character character)
        {
            // If character is a Farmer, return their eye color
            if (character is Farmer farmer)
            {
                return(farmer.newEyeColor.Value);
            }

            // If character is an NPC, return their eye color
            if (character is NPC npc && Blender.NPC_EYES.TryGetValue(npc.Name, out Color color))
            {
                return(color);
            }

            // Create a new random eye color (Fallback)
            return(Blender.NaturalEyeColor());
        }
Example #2
0
 /**
  * Get a random hair color using two parents
  */
 public static Color EyeColor(Character parent1, Character parent2) => Blender.AreAdopters(parent1, parent2) ? Blender.NaturalEyeColor() : Blender.GetEyeColor(parent1).Blend(Blender.GetEyeColor(parent2));