Skip to content

Instantly share code, notes, and snippets.

View Paint Code Expressions.md

PaintCode Expressions

Operators

!b boolean logical negation of b
x * y numbers product of numbers x and y

@cegiela
cegiela / ColorHash
Created Mar 17, 2017
Just the code for repeatably hashing a string into a color
View ColorHash
//Based on https://github.com/ngs/color-hash.swift
import UIKit
import XCPlayground
//magic numbers taken from original
let seed = CGFloat(131.0)
let seed2 = CGFloat(137.0)
let maxSafeInteger = 9007199254740991.0 / seed2