Add orx-shade-styles demo

This commit is contained in:
Edwin Jakobs
2020-04-07 21:05:08 +02:00
parent b9988f0341
commit 66b979fc84
2 changed files with 35 additions and 0 deletions

View File

@@ -1,3 +1,18 @@
sourceSets {
demo {
java {
srcDirs = ["src/demo/kotlin"]
compileClasspath += main.getCompileClasspath()
runtimeClasspath += main.getRuntimeClasspath()
}
}
}
dependencies { dependencies {
api project(":orx-parameters") api project(":orx-parameters")
demoImplementation("org.openrndr:openrndr-core:$openrndrVersion")
demoRuntimeOnly("org.openrndr:openrndr-gl3:$openrndrVersion")
demoRuntimeOnly("org.openrndr:openrndr-gl3-natives-$openrndrOS:$openrndrVersion")
demoImplementation(sourceSets.getByName("main").output)
} }

View File

@@ -0,0 +1,20 @@
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extra.shadestyles.radialGradient
import kotlin.math.cos
fun main() {
application {
program {
extend {
drawer.shadeStyle = radialGradient(
ColorRGBa.PINK,
ColorRGBa.PINK.toHSVa().shiftHue(180.0).scaleValue(0.5).toRGBa(),
exponent = cos(seconds)*0.5+0.5
)
drawer.rectangle(120.0, 40.0, 400.0, 400.0)
}
}
}
}