Swiftpack.co - Package - IrelDev/TelegramColorPicker


Simple telegram style color picker built with Swift & UIKit



CocoaPods is a dependency manager for Cocoa projects. To integrate TelegramColorPicker into your project using CocoaPods, specify it in your Podfile:

pod 'TelegramColorPicker'

After that use pod install command in your terminal.


Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate TelegramColorPicker into your Xcode project using Carthage, specify it in your Cartfile:

github "IrelDev/TelegramColorPicker"

After that use carthage update command in your terminal.

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. To integrate TelegramColorPicker into your Xcode project using Swift Package Manager, specify it in you Package:

dependencies: [
    .package(url: "https://github.com/IrelDev/TelegramColorPicker.git", .upToNextMinor(from: "1.3.0"))


If you prefer not to use any dependency managers, you can integrate TelegramColorPicker into your project manually by downloading the desired release and copying the Sources directory.


Sources downloaded directly from the master branch may be unstable, please download sources from releases page.



Create TelegramColorPicker instance then add it as a subview.

let frame = CGRect(x: .zero, y: .zero, width: 400, height: 250)
let colorPicker = TelegramColorPicker(frame: frame)


Drag UIView object from the object library and set TelegramColorPicker as a custom class in identity inspector. Create and connect @IBOutlet with TelegramColorPicker type.


Create struct that conforms to UIViewRepresentable protocol:

struct TelegramColorPickerRepresentable: UIViewRepresentable {
    func makeUIView(context: Context) -> TelegramColorPicker {
    func updateUIView(_ uiView: TelegramColorPicker, context: Context) { }

use it in your View:

var body: some View {
        .frame(width: 400, height: 250, alignment: .center)

Get color update

Use getColorUpdate function with your custom closure and don't forget to use [weak self] to avoid strong reference cycle.

getColorUpdate { [weak self] (_, color) in
           guard let newColor = color.newValue, let hexadecimalColor = newColor.toHex() else { return }
           self?.textLabel.text = hexadecimalColor


This repository contains example where you can see how TelegramColorPicker can be used for QRCode foreground color changing.


TelegramColorPicker is available under the MIT license, see the LICENSE file for more information.


Stars: 6


Used By

Total: 0


v1.3.1 - 2020-08-11 15:42:33

Release v1.3.1


  • The Brightness Slider can now be tapped anywhere to change its value


  • New shouldRespondTo X & Y tests added

v1.3.0 - 2020-08-09 12:36:58

Release v1.3.0

Dependency managers:

  • SwiftPM is now available


  • Added Unit Tests

v1.2 - 2020-07-31 02:38:30

Release v1.2

Performance improvement:

  • Constraints that are not based on view bounds are removed from layoutSubviews
  • View render became faster

v1.1.3 - 2020-06-29 03:56:27

Release v1.1.3

What's new:

  • Added Carthage support
  • Delegates are now public for custom color picker creation.

v1.1.2 - 2020-06-19 06:41:23

Release v1.1.2

User Interface:

  • The circle size & circle line width has been changed to a more appropriate size.

Bug fixes:

  • Fixed a bug when the circle goes over ColorPickerView bounds

v1.1.1 - 2020-06-10 11:56:12

Release v1.1.1

What's new:

  • Now TelegramColorPicker can be used with SwiftUI using UIViewRepresentable

Bug fixes:

  • Fixed TelegramColorPicker render preview in Storyboard
  • Fixed an issue that prevented TelegramColorPicker usage with SwiftUI

v1.1.0 - 2020-06-07 06:24:26

Release 1.1.0

Bug fixes:

  • Fixed hue & saturation issues. Added circle movement limitation in ColorPickerView

v1.0.1 - 2020-06-04 07:19:22

Release 1.0.1

Bug fixes:

  • Fixed TelegramColorPicker UIView creation, made init public

v1.0.0 - 2020-06-04 07:09:17

Initial Release