Yes, it is by the weight of the window. Each balance has a chart on its product page, and the chart tells you what weight range is covered by which color. The red and blue ranges overlap a little, so it's not unheard-of to alternate the two colors.
For peace of mind, you should know that if the window worked well in the past, you'd usually be safe to just use the same exact balance that was removed from the window. See whether you want to replace the exact balances, or whether you want to weigh to verify the tip colors.