Skip to content

GradientShader

final class GradientShader
Extends: ShaderProgram
Package: dev.joid.lib.shader.impl · Module: core · Source: GradientShader.java

The shader of linear gradients, which colors what is drawn along a line between two stops.

Color.bind and ColorGradient.use use it for a gradient color; you rarely call it yourself.

ReturnsSignatureSummary
GradientShaderinst() factoryReturns the shared shader.

ReturnsSignatureSummary
voiduse(Point startPoint, Point endPoint, Color startColor, Color endColor, Runnable runnable, BoundingBox canvas) staticRuns runnable with the gradient from startColor at startPoint to endColor at endPoint, points on 1 of canvas, then restores the previous shader.
voiduse(Point startPoint, Point endPoint, Color startColor, Color endColor, boolean hasTexture, Runnable runnable, BoundingBox canvas) staticRuns runnable with the gradient from startColor at startPoint to endColor at endPoint, then restores the previous shader; if hasTexture is true, the gradient multiplies the bound texture instead of replacing it.
Inherited from ShaderProgram (8)

delete · bind · unbind · getShader · canDraw · isAvailable · gradient · uniformGradient

GradientShader inst() factory

Returns the shared shader.

void use(Point startPoint, Point endPoint, Color startColor, Color endColor, Runnable runnable, BoundingBox canvas) static

Runs runnable with the gradient from startColor at startPoint to endColor at endPoint, points on 1 of canvas, then restores the previous shader.

void use(Point startPoint, Point endPoint, Color startColor, Color endColor, boolean hasTexture, Runnable runnable, BoundingBox canvas) static

Runs runnable with the gradient from startColor at startPoint to endColor at endPoint, then restores the previous shader; if hasTexture is true, the gradient multiplies the bound texture instead of replacing it.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page