mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 07:52:50 -05:00
core: add slices, paths, exec utils
This commit is contained in:
@@ -113,13 +113,14 @@ func RGBToHSV(rgb RGB) HSV {
|
||||
delta := max - min
|
||||
|
||||
var h float64
|
||||
if delta == 0 {
|
||||
switch {
|
||||
case delta == 0:
|
||||
h = 0
|
||||
} else if max == rgb.R {
|
||||
case max == rgb.R:
|
||||
h = math.Mod((rgb.G-rgb.B)/delta, 6.0) / 6.0
|
||||
} else if max == rgb.G {
|
||||
case max == rgb.G:
|
||||
h = ((rgb.B-rgb.R)/delta + 2.0) / 6.0
|
||||
} else {
|
||||
default:
|
||||
h = ((rgb.R-rgb.G)/delta + 4.0) / 6.0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user