Code Monkey home page Code Monkey logo

mrbgradientview's Introduction

MRBGradientView

MRBGradientView an iOS view class for creating gradients and shadows with ease. It supports usage through code as well as within the Interface Builder.

Supported Features

  • Gradient creation.
  • Custom starting and ending points.
  • Shadow color, blur, and opacity.
  • Shadow offset and spread.
  • Custom border radius.
  • Gradient and shadow animations.

Installation

MRBGradientView can be installed with CocoaPods.

In your Podfile, add MRBGradientView.

pod 'MRBGradientView'

Then install your Pods.

pod install

Docs

Properties

  • color1: The first gradient color.
  • color2: The second gradient color.
  • shadowHorizontalOffset: The horizontal offset for the shadow.
  • shadowVerticalOffset: The vertical offset for the shadow.
  • shadowColor: The color of the shadow.
  • shadowBlur: The blur radius for the shadow.
  • shadowSpread: The spread amount for the shadow.
  • color1HorizontalPosition: The horizontal position for color1, from 0 to 1. 0 represents the left edge, while 1 is the right edge.
  • color1VerticalPosition: The vertical position for color1, from 0 to 1. 0 represents the top edge, while 1 is the bottom edge.
  • color2HorizontalPosition: The horizontal position for color2, from 0 to 1. 0 represents the left edge, while 1 is the right edge.
  • color2VerticalPosition: The vertical position for color2, from 0 to 1. 0 represents the top edge, while 1 is the bottom edge.
  • borderRadius: The border radius for this view.

Methods

  • animateColors(toColor1, toColor2, duration, timingFunctionName): Animates the colors of this view.

    • toColor1: The new first color.
    • toColor2: The new second color.
    • duration: The length of the animation.
    • timingFunctionName: The timing function to use for this animation. Defaults to linear.
  • animateColor1Position(toHorizontalPosition, toVerticalPosition, duration, timingFunctionName): Animates the position of the first color.

    • toHorizontalPosition: The new horizontal position.
    • toVerticalPosition: The new vertical position.
    • duration: The length of the animation.
    • timingFunctionName: The timing function to use for this animation. Defaults to linear.
  • animateColor2Position(toHorizontalPosition, toVerticalPosition, duration, timingFunctionName): Animates the position of the second color.

    • toHorizontalPosition: The new horizontal position.
    • toVerticalPosition: The new vertical position.
    • duration: The length of the animation.
    • timingFunctionName: The timing function to use for this animation. Defaults to linear.
  • animateShadowColor(toShadowColor, duration, timingFunctionName): Animates the color of the shadow.

    • toShadowColor: The new shadow color.
    • duration: The length of the animation.
    • timingFunctionName: The timing function to use for this animation. Defaults to linear.
  • animateShadowRadius(toShadowRadius, duration, timingFunctionName): Animates the radius of the shadow.

    • toShadowRadius: The new shadow radius.
    • duration: The length of the animation.
    • timingFunctionName: The timing function to use for this animation. Defaults to linear.
  • animateShadowOpacity(toShadowOpacity, duration, timingFunctionName): Animates the opacity of the shadow.

    • toShadowOpacity: The new shadow opacity.
    • duration: The length of the animation.
    • timingFunctionName: The timing function to use for this animation.

mrbgradientview's People

Contributors

marco avatar

Stargazers

MohsinAli avatar

Watchers

MohsinAli avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.