Giter Club home page Giter Club logo

complimentarygradientview's Introduction

codebeat badge

ComplimentaryGradientView

Create complementary gradients generated from dominant and prominent colors in supplied image. Inspired by Grade.js ❤️

.all
gradientStartPoint: left
colors(start: .primary, end: .background)
gradientStartPoint:top

colors(start: .detail, end: .background)
gradientStartPoint:top |
colors(start: .secondary, end: .background)
gradientStartPoint:bottom :-------------------------:|:-------------------------: |

Demo

Sorry for the poor quality gif

Demo

Usage

Code

let gradientView = ComplimentaryGradientView(frame: CGRect(x: 0, y: 0, width: 300, height: 300))

//Colors for gradient are derived from the provided image
gradientView.image = UIImage(named: "myImg")

gradientView.gradientTpye = .colors(start: .primary, end: .secondary)

// Default = `.left`
gradientView.gradientStartPoint = .left

// Default = `.high`
gradientView.quality = .high

Storyboard

Demo

Migration Guide.

Version 3.0 introduces GradientVariant and reduces GradientType to two simple options:

// Create a gradient using all colors found in image
 case all 
 // Create gradient using variants. ie. .colors(start: .primary, end: .detail) 
 case colors(start: GradientVariant, end: GradientVariant) 

Installation

CocoaPods

ComplimentaryGradientView is available through CocoaPods. To install it, simply add the following line to your Podfile:

Swift 4.2

pod 'ComplimentaryGradientView', '~> 3.0'

Swift3.

pod 'ComplimentaryGradientView', '~> 0.1.7'

Swift 2.2

pod 'ComplimentaryGradientView', '~> 0.1.0'

Manually

Download and drop ComplimentaryGradientView.xcodeproj into your project OR Drag Source folder into your project.

Dependencies

UIImageColors

License

ComplimentaryGradientView is available under the MIT license. See the LICENSE file for more info.

complimentarygradientview's People

Contributors

basthomas avatar gkye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

complimentarygradientview's Issues

Setting image programmatically with a URLRequest

Are images able to be set without specifying the image name in the Storyboard? For some reason, when I set the image programmatically, to either an image in the project or one downloaded from the web, it doesn't work unless I specify it in the storyboard as well.

@IBOutlet weak var gradientBG: ComplimentaryGradientView!

let bg : UIImage = largeImage
self.gradientBG.image = UIImage(named: "test.png")
self.gradientBG.gradientTpye = .backgroundPrimary
self.gradientBG.gradientStartPoint = .left

This works when I set the following in Storyboard:
screen shot 2016-10-10 at 4 12 29 pm

However, because I want to generate a gradient from an image downloaded from the web, I cannot set it's filename in Storyboard.

Is there something I'm missing to be able to set a gradient on an image without specifying it's name in Storyboard?

Thank you for the fantastic project!

tvOS Target

Hello,

can you add tvOS Target? I want to use ComplimentaryGradientView in my tvOS Project

Thank you

Manual Installation

CocoaPods and Carthage are awesome tools and make our life really easier, but there are some devs who still don't know how to use them.

It would be cool to add the Manual installation guide in your README.md. You can take a look at my iOS Readme Template to see how you can do it.

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.