I've heard in job contracts there can be clauses saying that all intellectual property created by the employee during their employment, belongs to the company, regardless if it's done during hours they are not working.
So for example if a computer programmer works Monday to Friday but on the weekend he develops an app (without using company resources) the company can claim ownership of it. Would such a clause be enforceable? Would it make a difference if it's related to the job or not, for example if the programmer made a painting that became famous, could the company still claim ownership?
What is the name of such clauses?