[orx-shade-styles] Write comments on demos
This commit is contained in:
@@ -10,6 +10,14 @@ import org.openrndr.extra.shadestyles.fills.gradients.gradient
|
||||
import org.openrndr.extra.shapes.primitives.grid
|
||||
import org.openrndr.math.Vector2
|
||||
|
||||
/**
|
||||
* A design with 48 vertical bands with gradients. Each one has a unique `quantization`
|
||||
* value based on the index of the band. All bands have 2 color `stops`:
|
||||
* `WHITE` at the top (position 0.0), and `BLACK` near the bottom (near position 1.0),
|
||||
* with the exact value depending on the `quantization` value.
|
||||
*
|
||||
* Demonstrates how to produce a quantized gradient with a specific number of equal color bands.
|
||||
*/
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
@@ -25,7 +33,7 @@ fun main() = application {
|
||||
drawer.shadeStyle = gradient<ColorRGBa> {
|
||||
quantization = index + 2
|
||||
stops[0.0] = ColorRGBa.WHITE
|
||||
stops[ (quantization) / (quantization+1.0)] = ColorRGBa.BLACK
|
||||
stops[(quantization) / (quantization + 1.0)] = ColorRGBa.BLACK
|
||||
|
||||
fillUnits = FillUnits.BOUNDS
|
||||
fillFit = FillFit.COVER
|
||||
|
||||
Reference in New Issue
Block a user