-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from indragiek/color-diff
Add CIE76 and CIE94 algorithms
- Loading branch information
Showing
10 changed files
with
164 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// INVector3SwiftExtensions.swift | ||
// DominantColor | ||
// | ||
// Created by Indragie on 12/24/14. | ||
// Copyright (c) 2014 Indragie Karunaratne. All rights reserved. | ||
// | ||
|
||
extension INVector3 { | ||
func unpack() -> (Float, Float, Float) { | ||
return (x, y, z) | ||
} | ||
|
||
static var identity: INVector3 { | ||
return INVector3(x: 0, y: 0, z: 0) | ||
} | ||
} | ||
|
||
func +(lhs: INVector3, rhs: INVector3) -> INVector3 { | ||
return INVector3(x: lhs.x + rhs.x, y: lhs.y + rhs.y, z: lhs.z + rhs.z) | ||
} | ||
|
||
func /(lhs: INVector3, rhs: Float) -> INVector3 { | ||
return INVector3(x: lhs.x / rhs, y: lhs.y / rhs, z: lhs.z / rhs) | ||
} | ||
|
||
func /(lhs: INVector3, rhs: Int) -> INVector3 { | ||
return lhs / Float(rhs) | ||
} |
Oops, something went wrong.