IANAL, but even in California, if it relates to the business of the employer then they own it, even if you do it on your own time, on your own equipment. By definition, if you use that code while performing your job duties, then the company owns it. If you are in Washington State, then your employment contract can (and therefore will) state that anything you write, they own, and this is legal and enforceable. Again, IANAL.