pe•num•bra
/pəˈnəmbrə/
noun
the partially shaded outer region of the shadow cast by an opaque object.
This repo is inspired by this blog post from InVision which taught me to make these amazing, fluffy drop shadows in Sketch 3. It is a spin off of the work of bennibrightside called ShadowView.
Penumbra views can be used with in Interface Builder or be build programatically. The properties for cornerRadius
, shadowOffset
, shadowRadius
, shadowOpacity
and shadowColor
can be modified via Interface Builder.
To install Penumbra, clone this repository and drag the Penumbra
folder into your Xcode project.
1.) Create a UIView or UIButton in Interface Builder.
2.) Change the UIView/UIButton's identity to inherit from PenumbraView/PenumbraButton depending on what element you're trying to modify.
3.) In the Attributes Inspector, feel free to tweak any settings you'd like thanks to @IBInspectable.
4.) Enjoy the magical diffused drop shadows! 🔮
Caleb Stultz, kalub92@gmail.com
Penumbra is available under the MIT license. See the LICENSE file for more info.