I want to get the Master Sword before taking on Vah Medoh, but I only have 9 hearts. I do have Mipha's Grace, and if it activates, it gives me 5 more yellow hearts. Can I pull out the Master Sword with this combination, or do all of the hearts have to be red?
No, only the red hearts count.
From the Prima guide:
To get the Master Sword you need a total of 13 hearts. Any additional hearts you get from food or other abilities do not count toward the 13-heart total. You have to have 13 hearts as Link’s base health to pull the Master Sword from the ground.