Add orx-shade-styles demo
This commit is contained in:
@@ -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)
|
||||||
|
|
||||||
}
|
}
|
||||||
20
orx-shade-styles/src/demo/kotlin/DemoRadialGradient01.kt
Normal file
20
orx-shade-styles/src/demo/kotlin/DemoRadialGradient01.kt
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user