This commit is contained in:
2021-08-15 08:36:23 +02:00
parent 1dc6f6cf9f
commit d4a8b18ec2
10 changed files with 272 additions and 55 deletions

View File

@@ -296,7 +296,8 @@ class Color(value: String) : CssProperty(value) {
}
}
if (saturation == 0) return RGBA(lightness, lightness, lightness)
val lightness255 = lightness * 255 / 100
if (saturation == 0) return RGBA(lightness255, lightness255, lightness255)
// scale H, S, V values into 0..1 fractions
val h = (hue % 360.0) / 360.0