Git Product home page Git Product logo

dsgraphicskit's Introduction

DSGraphicsKit

Utilities for common and advanced graphics operations.

DSGraphicsKit provides support to quickly perform the following operations:

  • Images:
    • Create icons with fills, glows and shadows from the alpha channel of an image.
    • Resize with corner rounding.
    • Render a layer to an image.
  • Views:
    • Add a 3d rotation along the y axis.
    • Add a reflection.
  • Animations:
    • Add a pop up animation to a layer.

Installation

Use CocoaPods:

pod 'DSGraphicsKit'

Usage

Rotating and adding a reflection to a view:

UIView *view;
[view setYRotation:25.0f];
[view addReflectionToSuperLayer];

Icons:

UIImage *source;
UIImage *fill;
UIColor *color1;
UIColor *color2;

UIImage *icon0 = [source gradientIconWithRGBColors:[NSArray arrayWithObjects:color1, color2, nil]];
UIImage *icon1 = [fill applyAlphaFromImage:source glowWidth:5.0f offset:CGSizeZero color:color1];
UIImage *icon2 = [source iconWithForeground:fill background:[UIColor colorWithWhite:0.1 alpha:1.0] radius:4.0];

Images resizing with corners rounding:

UIImage *original;
UIImage *new = [original imageResizedToSize:CGSizeMake(160, 160)
                           withCornerRadius:24.0f
                                    corners:DSCornerTopLeft | DSCornerBottomRight
                               transparency:NO];

Animations:

UIView *view;
[view.layer addPopUpAnimation];

dsgraphicskit's People

Contributors

fabiopelosin avatar yannliang avatar

Watchers

 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.