[orx-color] Fix deprecation in demos
`.saturated` is now `.clip()`
This commit is contained in:
@@ -38,7 +38,7 @@ fun main() {
|
|||||||
for (hue in 0 until 360 step 4) {
|
for (hue in 0 until 360 step 4) {
|
||||||
for (chroma in 0 until 100 step 1) {
|
for (chroma in 0 until 100 step 1) {
|
||||||
val lch = ColorOKLCHa(cos(seconds * 0.1) * 0.5 + 0.5, chroma / 100.0, hue.toDouble())
|
val lch = ColorOKLCHa(cos(seconds * 0.1) * 0.5 + 0.5, chroma / 100.0, hue.toDouble())
|
||||||
val srgb = lch.toRGBa().toSRGB().saturated
|
val srgb = lch.toRGBa().toSRGB().clip()
|
||||||
write(srgb)
|
write(srgb)
|
||||||
write(Vector3((srgb.r - 0.5) * 10.0, (srgb.g - 0.5) * 10.0, (srgb.b - 0.5) * 10.0))
|
write(Vector3((srgb.r - 0.5) * 10.0, (srgb.g - 0.5) * 10.0, (srgb.b - 0.5) * 10.0))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ fun main() {
|
|||||||
for (lumo in 0 until 100 step 1) {
|
for (lumo in 0 until 100 step 1) {
|
||||||
for (chroma in 0 until 100 step 1) {
|
for (chroma in 0 until 100 step 1) {
|
||||||
val lch = ColorOKLCHa(lumo / 100.0, chroma / 100.0, cos(seconds * 0.1) * 360.0)
|
val lch = ColorOKLCHa(lumo / 100.0, chroma / 100.0, cos(seconds * 0.1) * 360.0)
|
||||||
val srgb = lch.toRGBa().toSRGB().saturated
|
val srgb = lch.toRGBa().toSRGB().clip()
|
||||||
write(srgb)
|
write(srgb)
|
||||||
write(Vector3((srgb.r - 0.5) * 10.0, (srgb.g - 0.5) * 10.0, (srgb.b - 0.5) * 10.0))
|
write(Vector3((srgb.r - 0.5) * 10.0, (srgb.g - 0.5) * 10.0, (srgb.b - 0.5) * 10.0))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ fun main() {
|
|||||||
drawer.fontMap = loadFont("demo-data/fonts/IBMPlexMono-Regular.ttf", 16.0)
|
drawer.fontMap = loadFont("demo-data/fonts/IBMPlexMono-Regular.ttf", 16.0)
|
||||||
for ((_, steps) in allSteps) {
|
for ((_, steps) in allSteps) {
|
||||||
for (i in steps.indices) {
|
for (i in steps.indices) {
|
||||||
val srgb = steps[i].toSRGB().saturated
|
val srgb = steps[i].toSRGB().clip()
|
||||||
drawer.fill = srgb
|
drawer.fill = srgb
|
||||||
drawer.isolated {
|
drawer.isolated {
|
||||||
drawer.translate((srgb.r - 0.5) * 10.0, (srgb.g - 0.5) * 10.0, (srgb.b - 0.5) * 10.0)
|
drawer.translate((srgb.r - 0.5) * 10.0, (srgb.g - 0.5) * 10.0, (srgb.b - 0.5) * 10.0)
|
||||||
@@ -56,7 +56,7 @@ fun main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
val positions = steps.map {
|
val positions = steps.map {
|
||||||
val l = it.toSRGB().saturated
|
val l = it.toSRGB().clip()
|
||||||
Vector3((l.r - 0.5) * 10.0, (l.g - 0.5) * 10.0, (l.b - 0.5) * 10.0)
|
Vector3((l.r - 0.5) * 10.0, (l.g - 0.5) * 10.0, (l.b - 0.5) * 10.0)
|
||||||
}
|
}
|
||||||
drawer.stroke = ColorRGBa.BLACK.opacify(0.25)
|
drawer.stroke = ColorRGBa.BLACK.opacify(0.25)
|
||||||
|
|||||||
Reference in New Issue
Block a user