Skip to content

Instantly share code, notes, and snippets.

@Kleemann
Kleemann / README.md
Created October 16, 2018 08:55 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

//
// UIView+Layout.swift
//
// Created by Mads Kleemann on 12/08/2018.
//
import UIKit
public extension UIView {
//
// DatabaseWorker.swift
// Readlst
//
// Created by Mads Kleemann on 04/08/2017.
// Copyright (c) 2017 Readlst. All rights reserved.
//
import UIKit
import RealmSwift