All Projects β†’ maxkonovalov β†’ Mkgradientview

maxkonovalov / Mkgradientview

Licence: mit
🌈 Highly customizable Core Graphics based gradient view for iOS

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Mkgradientview

Gradient
Library for dealing with color gradients in ruby
Stars: ✭ 15 (-90.57%)
Mutual labels:  gradient
Colorgrad
Go (Golang) color scales library for maps, charts, data-visualization & creative coding.
Stars: ✭ 96 (-39.62%)
Mutual labels:  gradient
Gradientappbar
Gradient app bar for Flutter
Stars: ✭ 118 (-25.79%)
Mutual labels:  gradient
Rwidgethelper
Android UI εΏ«ι€ŸεΌ€ε‘οΌŒδΈ“ζ²»εŽŸη”ŸζŽ§δ»Άε„η§δΈζœ
Stars: ✭ 996 (+526.42%)
Mutual labels:  gradient
Dtgradientbutton
Easy way to set gradient background to your buttons.
Stars: ✭ 76 (-52.2%)
Mutual labels:  gradient
Kaloader
Beautiful animated placeholders for showing loading of data
Stars: ✭ 99 (-37.74%)
Mutual labels:  gradient
Zygote.jl
Intimate Affection Auditor
Stars: ✭ 933 (+486.79%)
Mutual labels:  gradient
Gradstop
JavaScript micro library to generate gradient color stops πŸ³οΈβ€πŸŒˆ
Stars: ✭ 144 (-9.43%)
Mutual labels:  gradient
Stepper
Fancy Step Wizard 😎
Stars: ✭ 80 (-49.69%)
Mutual labels:  gradient
Shapy
Shapy is a CSS gradient editor that lets you size, position and layer CSS gradients on a single div element.
Stars: ✭ 115 (-27.67%)
Mutual labels:  gradient
Grview
UIView and other UIKit elements with a gradient and other attributes for IOS
Stars: ✭ 39 (-75.47%)
Mutual labels:  gradient
Mkringprogressview
⭕️ Ring progress view similar to Activity app on Apple Watch
Stars: ✭ 1,140 (+616.98%)
Mutual labels:  gradient
Typrogressbar
Custom animating gradient progress bar
Stars: ✭ 106 (-33.33%)
Mutual labels:  gradient
Ahoy Onboarding
Android onboarding library.
Stars: ✭ 951 (+498.11%)
Mutual labels:  gradient
React Native Css Gradient
React Native css gradients - react-native-linear-gradient with css gradient support
Stars: ✭ 129 (-18.87%)
Mutual labels:  gradient
Progressroundbutton
A DownloadProgressButton with Animation for Android
Stars: ✭ 864 (+443.4%)
Mutual labels:  gradient
Awesome Gradient
😎 A curated list of awesome Gradient frameworks, libraries and software and resources
Stars: ✭ 98 (-38.36%)
Mutual labels:  gradient
Deep Viz Keras
Implementations of some popular Saliency Maps in Keras
Stars: ✭ 154 (-3.14%)
Mutual labels:  gradient
Colorbands
Unity 3D's Gradient is a handy data type but comes with some limitations: for example you cannot set more than 8 color keys in its editor and RGB is the only color space available. ColorBand data type offers an alternative with less limitations. Creating ColorBands is fun and easy; they are stored as assets and can be accessed from code through an Evaluate method to get the color at time t, as for Gradient. RGB (or HSV) values are described by individual curves, allowing a better control over how the color function evolves between your points. Color bands are used in all kinds of applications including games, data visualization and other fields.
Stars: ✭ 137 (-13.84%)
Mutual labels:  gradient
Gradientpathrenderer
Renders MKPolyline with a fancy multicoloured gradient fill
Stars: ✭ 112 (-29.56%)
Mutual labels:  gradient

MKGradientView

Language Platform License Version Carthage compatible

Highly customizable Core Graphics based gradient view

MKGradientView

Features

Available gradient types:

  • Linear (Axial)
  • Radial (Circular)
  • Conical (Angular)
  • Bilinear (Four Point)

Installation

CocoaPods

To install MKGradientView via CocoaPods, add the following line to your Podfile:

pod 'MKGradientView'

Carthage

To install MKGradientView via Carthage, add the following line to your Cartfile:

github "maxkonovalov/MKGradientView"

Usage

See example Xcode project

Interface Builder

Simple 2-color gradients can be set up in Interface Builder. Set your view's custom class to MKGradientView.

You can specify the following custom inspectable properties:

  • Gradient Type
  • Start Color
  • End Color
  • Start Point
  • End Point

Code

let gradientView = GradientView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
gradientView.type = .linear
gradientView.colors = [.red, .green]
gradientView.locations = [0, 1]
gradientView.startPoint = CGPoint(x: 0, y: 0)
gradientView.endPoint = CGPoint(x: 1, y: 1)
view.addSubview(gradientView)

To set up a Bilinear gradient, you need to specify colors2 array:

let gradientView = GradientView(frame: CGRect(x: 100, y: 0, width: 100, height: 100))
gradientView.type = .bilinear
gradientView.colors = [.red, .yellow]
gradientView.colors2 = [.blue, .cyan]
view.addSubview(gradientView)

Performance

GradientLayer is image-backed, and the algorithm performance behind it highly depends on the size of the generated image. To speed it up, minimum possible layer size should be used. It can be adjusted with GradientLayer's contentsScale property, 1.0 being an optimal value for performance/quality balance. Use lower values like 0.5 to speed up rendering time or set it equal to UIScreen.main.scale to get precise result.

Requirements

  • iOS 8.0
  • Xcode 10, Swift 4+

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].