Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ImagePalette.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ Pod::Spec.new do |s|
s.source_files = "src/*.swift"
s.requires_arc = true

s.dependency 'SwiftPriorityQueue', '~> 1.1.2'
s.dependency 'SwiftPriorityQueue', '~> 1.3.1'
end
4 changes: 2 additions & 2 deletions src/PaletteSwatch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ open class PaletteSwatch {
private let hex: Int64

/** This swatch’s color */
open let color: UIColor
public let color: UIColor

/** The number of pixels represented by this swatch */
open let population: Int64
public let population: Int64

private var generatedTextColors: Bool = false
private var _titleTextColor: UIColor?
Expand Down
5 changes: 3 additions & 2 deletions src/RGBColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ internal struct RGBColor: Hashable, Equatable {
self.green = green
self.blue = blue
self.alpha = alpha
let maxInt = Int64(Int32.max)
self.hashValue = Int(((alpha << 24) | (red << 16) | (green << 8) | blue) % maxInt)
let maxInt = Int64(Int32.max)
let base = ((alpha << 24) | (red << 16) | (green << 8) | blue)
self.hashValue = Int(base % maxInt)
}

init(color: UIColor) {
Expand Down