It is an aid for the mounting system and a legacy from when pentax switched from the M42 screwmount to the bayonet K mount.
Try closing your eyes and picking up the lens. Locate the button and then fit the lens to your camera. While it is not quite as convenient as on the older cameras when it lined up with the lens lock on the body, it helps you to orient the lens to the bayonet mount.
The colour is like the luminescent plastic found on children's toys. Put the lens under a desk lamp and then take it into a dark cupboard and see if the green/white dot glows.