Good for you.
Most agreements for contract employees specifically said anything developed by the contractor became the property of the employing company.
Copyright law even has writing/development-for-hire provisions that give the employER, not the hirEE, rights to projects developed by the hirEE during employment.
Disclaimer: All agreements/contracts should be read closely.
I worked for a copy once, as a full employee, not contractual. We were required, however, to sign an agreement. That agreement stated than, if we left the company, they had the right to disavow that we had ever worked for them. (The company developed software for grocery wholesalers and stores; it wasn't secret DOD stuff. lol.) Needless to say, we balked at that provision and refused to sign until that was removed.
To our surprize, we were told Monday that we would be given shares in the company.
Nobody was more suprized, than the two of us.