-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refine group mixing and visualization
- Loading branch information
Showing
7 changed files
with
40 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
fn hsv_to_rgb(h: f32, s: f32, v: f32) -> vec3<f32> { | ||
let c = v * s; | ||
let x = c * (1.0 - abs((h / 60.0) % 2.0 - 1.0)); | ||
var q = vec3<f32>(v - c); | ||
if (h < 60.0) { | ||
q.r += c; q.g += x; | ||
} else if (h < 120.0) { | ||
q.g += c; q.r += x; | ||
} else if (h < 180.0) { | ||
q.g += c; q.b += x; | ||
} else if (h < 240.0) { | ||
q.b += c; q.g += x; | ||
} else if (h < 300.0) { | ||
q.b += c; q.r += x; | ||
} else { | ||
q.r += c; q.b += x; | ||
} | ||
return q; | ||
} |
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