[orx-shade-styles] Add OKLab color space support to gradients
This commit is contained in:
34
orx-shade-styles/src/demo/kotlin/DemoLinearGradient.kt
Normal file
34
orx-shade-styles/src/demo/kotlin/DemoLinearGradient.kt
Normal file
@@ -0,0 +1,34 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.shadestyles.linearGradient
|
||||
|
||||
import org.openrndr.extra.shadestyles.radialGradient
|
||||
import org.openrndr.extras.color.spaces.toOKLABa
|
||||
import kotlin.math.cos
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
drawer.shadeStyle = linearGradient(
|
||||
ColorRGBa.RED.toOKLABa(),
|
||||
ColorRGBa.BLUE.toOKLABa(),
|
||||
)
|
||||
drawer.rectangle(120.0, 40.0, 200.0, 400.0)
|
||||
|
||||
drawer.shadeStyle = linearGradient(
|
||||
ColorRGBa.RED,
|
||||
ColorRGBa.BLUE
|
||||
)
|
||||
|
||||
drawer.rectangle(120.0+200.0, 40.0, 200.0, 400.0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user