Skip to content
Member Filters
Show Inherited
Show Protected
Show abstract
GR32_ColorGradients🞂TRadialExGradientSamplerClass

TRadialExGradientSampler

HTML5 radial gradient.

Inheritance:TObject 🞂 TPersistent 🞂 TNotifiablePersistent 🞂 TCustomSampler 🞂 TCustomGradientSampler 🞂 TCustomGradientLookUpTableSampler 🞂 TRadialExGradientSampler

Declaration ​

pascal
TRadialExGradientSampler = class(TCustomGradientLookUpTableSampler)

Description ​

TRadialExGradientSampler provides gradation of colors along a cylinder defined by two circles (C1,R1) and (C2,R2). Also knows as "two point conical gradient".

ClampMirrorRepeat

Colors are mapped according to WrapMode.

Mathematics & Algorithm ​

Given focal center C1=(X1,Y1) and outer center C2=(X2,Y2), sampling parameter t solves the quadratic intersection equation between the line segment from C1 to (X,Y) and the moving interpolated circle:

C(t)=C1+t(C2−C1),R(t)=R1+t(R2−R1)

Solving ∥(X,Y)−C(t)∥2=R(t)2 yields normalized gradient offset u=t.

References ​