Here's what I found: For each guess, Worldle calculates a proximity score from 0 to 100 -- higher is better. Each row is basically a quantized proximity score meter, from 0 to 100 in increments of 20. If you get at least half-way to the next increment of 20 (i.e. to the next green square), you get a yellow square, too.
Example: If your proximity score for a guess is 63, you'll get 3 green squares and two blank (white or black) squares, i.e. GGGBB. If your score is 71, you'll get three green squares, and since 71 is at least half-way to 80 (i.e. >= 70), you'll also get a yellow square, so GGGYB.
The proximity score is round(100*(MAX_DISTANCE_ON_EARTH - d)/MAX_DISTANCE_ON_EARTH). Though that max distance is defined to be 20,000,000.
This is the important part: https://github.com/teuteuf/worldle/blob/67db30bdf79c0965c19a...