All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.NPointGradient.kt Maven / Gradle / Ivy

There is a newer version: 0.4.5-alpha6
Show newest version
package org.openrndr.extra.shadestyles

import org.openrndr.color.ColorRGBa
import org.openrndr.draw.ShadeStyle
import org.openrndr.extra.parameters.Description
import org.openrndr.math.Vector2

@Description("N-Point gradient")
class NPointGradient(
        colors: Array,
        points: Array = arrayOf(Vector2.ZERO)) : ShadeStyle() {

    var colors: Array by Parameter()
    var points: Array by Parameter()

    init {
        this.colors = colors
        this.points = points

        fragmentTransform = """
                float sum = 0;
                vec4 rgba = vec4(0.0);
                for(int i=0; i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy