The main cause of skin cancer is overexposure to the sun. The body's natural defense against damaging ultra-violet radiation from the sun is a pigment called melanin. However, even the darkest skin doesn't contain enough melanin to prevent damage resulting from exposure to the sun. Outdoor workers, such as farmers, have an increased risk of skin cancer due to the lengths of time they spend working in the sun. Fabric provides an excellent source of protection against the sun.
Darker colors tend to block more sun.
You should look for a rating of 15 or higher. Generally, a tighter weave of fabric gives more protection. For example, denim jeans have a SPF of 1,700. A hat should have a 4 inch brim all around or a broad bill and flap to cover your ears. Sunscreen is the best way to protect any exposed skin.