I live in Colorado and I found this on the Colorado Bar Association's website.
The Landlord’s Obligation to Repair
[i]The terms of the lease determine the landlord’s obligation to repair the property. Otherwise, the landlord is obligated to repair the property only when:
• Gas burning equipment causes a hazard. A tenant is allowed to move out if repairs to defective and hazardous gas equipment are not made within 72 hours after notice to the landlord. (In such a situation, a tenant is entitled to a full refund of the deposit and a rent rebate)
• The landlord has made a binding agreement to repair the premises
• The landlord’s failure to repair the premises violates the covenant of quiet enjoyment of the premises (see explanation below)
• The repairs are for the common areas
• The repairs are necessary to correct a dangerous or hidden defect
Express Promise
If the tenant can show an express promise to repair by the landlord and a failure to fulfill that promise, the tenant has some options. In theory, he or she can move out without liability. However the tenant is encouraged to consult with an attorney before doing so, because the tenant who takes this approach should be prepared to defend his/her actions in a lawsuit commenced by the landlord. If the tenant has given the landlord money for advance rent and a security deposit, he or she is entitled to rescind the agreement and get the return of all the money paid to the landlord.
The tenant may also use the remedy of "repair and deduct," which means that the tenant can pay for the repair and then deduct the cost from the next month’s rent. This remedy should be used only in situations where the landlord has clearly promised to make repairs and has failed to do so, after a written demand from the tenants. The tenants should notify the landlord, again in writing, that the cost of the repairs will be withheld from the next payment of rent. The tenant should keep receipts and other necessary records to prove the amount deducted was necessary to perform the repairs.
Tenants who invoke this remedy should be prepared to defend their rent deductions in the event of an eviction based on non-payment of rent. The record of notices to the landlord and receipts or work orders for repairs made is essential to show the court that the repair and deduct remedy has been used correctly. [/i]
From this I gather that as long as it is written and agreed to in the lease, it is legal. Is that what you read?
Mike