Most peppers turn into a different color when mature, usually red but not always. Ripeness and maturity are two different things. Ripeness is when a fruit is ready to eat. Maturity is when a fruit is able to reproduce. It is possible for a pepper that is not completely mature to have viable seeds but not probable. Let's take bell peppers for instance. You can have a nice big green pepper and when you cut it open the seeds are small and sparse but the fruit is still plenty ripe to eat, perfect for salads and stuffing. Those immature seeds will not be viable, some will be larger and/or different in shape. Take the same variety of pepper that is it's mature color, cut it open and there will be lots of seeds and they are all just about identical. Usually maturity comes with the fruit just starting to change colors, in peppers usually a light yellow or a faint blush of pink. The absolute best and most viable seeds come from a fruit, be it a pepper or a tomato that has reached its complete maturity and has achieved its complete color and has become what I would say is overripe. In a pepper that would be a pepper on the plant that is starting to shrivel and a tomato would be really soft, almost squishy. Virtually 100% of those seeds will be viable.