“During the 1800s, the best graphite in the world came from China. American pencil makers wanted a special way to tell people that their pencils contained Chinese graphite,” explains a post on Pencils.com, an online retailer of writing supplies. “In China, the color yellow is associated with royalty and respect. American pencil manufacturers began painting their pencils bright yellow to communicate this ‘regal’ feeling and association with China.”
Apparently, as Arsty.net also explains, Czech pencil manufacturer Hardtmuth Pencil first painted their pencils yellow circa 1889 to advertise this Chinese connection and indicate the graphite’s sourcing from China.