Giter Club home page Giter Club logo

gauges's Introduction

Gauges

Gauges gives you a nice looking circular progress view.

Usage

You can customize almost every visual aspect of the view using Gauge struct .

struct Gauge {
    enum Color {
        case gradient([(color: UIColor, location: CGFloat)])
        case solid(UIColor)
    }

    enum Direction {
        case clockwise
        case counterClockwise
    }

    var value: Float
    var color: Color
    var radius: CGFloat
    var lineWidth: CGFloat
    var backgroundColor: Color
    var direction: Direction
    var startAngle: CGFloat

}

gaugeView.gauges = [
    Gauge(value: 0, color: .gradient([(.yellow, 0), (.orange, 1)]), radius: 60, lineWidth: 15),
    Gauge(value: 0, color: .gradient([(.cyan, 0), (.green, 1)]), radius: 90, lineWidth: 15),
    Gauge(value: 0, color: .gradient([(.blue, 0), (.magenta, 1)]), radius: 120, lineWidth: 15)
]

Additionally you can customize shadows with Shadow struct:

struct Shadow {
    enum Color {
        case colors([UIColor])
        case blur
    }

    var color: Color
    var offset: CGSize
    var opacity: CGFloat
    var radius: CGFloat
}

gaugeView.shadow = Shadow(color: .blur)

You can access and change values of each gauge individually:

gaugeView.gauges[0].value = 0.5

Limitations

UIVisualEffectView was used for gradient shadow, which comes with some limitations:

  • everything that you put behind GagueView will be blurred, to avoid that set it an opaque background color
  • you can not change shadow radius after it was set for the first time when you use .blur shadow color
  • you may notice some color artifacts on the edges of GaugeView even if you use solid background color

Used by

Aconta: income and expenses

gauges's People

Contributors

ilyapuchka avatar

Stargazers

 avatar Stefan avatar Yasuhiro Inami avatar Nikola avatar David Rodrigues avatar Tim Kersey avatar ShadowParticle avatar Sergey Reshetnyak avatar Pho Hale avatar Danny Zorin avatar feng.zhang avatar Alexey Gerasimov avatar Max avatar VAndrJ avatar Alexander Kononenko avatar N S avatar Egor Merkushev avatar magnus avatar Akim avatar  avatar Eli Perkins avatar RV avatar Naoki Fujii avatar Jonathan avatar Vitaly Baev avatar Joel Fischer avatar Samet Macit avatar Astemir Eleev avatar Olexii Pyvovarov avatar Dzhunet Hasan avatar Tank avatar Masamichi Ueta avatar mono — Masayuki Ono avatar Krunal Doshi avatar Robin Chou avatar Zdeněk Topič avatar Gleb Karpushkin avatar  avatar Matej Ľach avatar Yaniv Danan avatar Pavel avatar Kiryl Budzevich avatar Soslan-Bek Tsomaev avatar Lindy avatar Aakash Srivastav avatar Dinesh Kachhot avatar Toseef Khilji avatar  avatar  avatar Moonlight avatar  avatar Michael Pchelnikov avatar Ezimet Imam avatar  avatar Florian avatar simorgh3196 avatar Igor Vasilenko avatar Zakhar Babkin avatar Konstantinos N. avatar Amir Abbas Mousavian avatar Anthony Da Mota avatar Sergey Zhuravel avatar Konstantin avatar Sergey Alyasev avatar Vlad Korzun avatar Yuriy Tarnavskiy avatar Danil Pestov avatar Kos avatar Sergei Belous avatar Rufat Babayev avatar Anton Marunko avatar Sergii Kryvoblotskyi avatar Aleksei Artemev avatar Maxim Tsvetkov avatar Anıl Göktaş avatar Vlad avatar Dmitry Zhukov avatar Maksim Kudriavtsev avatar Valery Silin avatar Serhii Stavytskyi avatar andrii.kravchenko avatar Vitalii Shevtsov avatar Anistratenko Roman avatar Sergey Pugach avatar Vasco d'Orey avatar Bernhard Loibl avatar Max avatar

Watchers

Ben Bahrenburg avatar James Cloos avatar Toseef Khilji avatar Max avatar Andrew S 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.