It appears last quarter's homebuilding challenges didn't mean a permanent stain on Sherwin-Williams' (NYSE:SHW) results for the rest of the year. That's because the paint company just reported second-quarter results that were ahead of expectations and raised its full-year guidance.  

Total sales for the quarter only improved a couple of percent, but diluted earnings grew more than 14% because management was able to boost gross margins and finally beat back the "significant rise in raw material costs during 2004, 2005 and 2006." A couple of minor acquisitions also helped offset weakness in the consumer group, as do-it-yourself painters and retail clients are indeed being hit by subprime worries and plummeting new-home construction that is hitting homebuilders such as Pulte (NYSE:PHM), D.R. Horton (NYSE:DHI), and Toll Brothers (NYSE:TOL).

Strong international numbers -- especially in automotive paint in South America -- also helped bolster anemic trends here at home, and Sherwin-Williams introduced new products in the U.K. Overall, management is positive enough to brush aside the homebuilding issues for the time being,  increasing full-year earnings guidance to $4.60 to $4.70, or as much as 12% year-over-year growth.

You have to commend management for ably navigating the tough residential housing environment, and the stock just hit a 52-week high on the second-quarter strength. The only potential drag on the shares is renewed interest from a number of states in pursuing lead-paint litigation against Sherwin-Williams and NL Industries (NYSE:NL) after Rhode Island experienced some success in pursuing related cleanup costs. DuPont (NYSE:DD) settled with the state a while back, but the others continue to head to court to settle any disputes. So far, they haven't experienced any major adverse rulings.                                   

For related Foolishness:

Need new ideas for your money? Talk stocks with other investors and our analysts when you give our newsletters a try.

Fool contributor Ryan Fuhrmann has no financial interest in any company mentioned. Feel free to email him with feedback or to discuss any companies mentioned further. The Fool has an ironclad disclosure policy.