channel
Which part of the child's color drives a particle: luminance, luminanceInverted, red, green, blue, saturation or alpha, each a number in 0–1.
channel: { luminance, luminanceInverted, red, green, blue, saturation, alpha, byMode }
Import sim from shaders/std and use sim.agentForces.channel.
byMode maps a select prop's number (0 luminance … 6 alpha) to the same functions.
Example
integrator.relief(fieldLayout, {channel: channel.byMode[channelMode] ?? channel.luminance, cursor: force.cursorInView(fieldLayout, {perspK: 0.9}), stiffness: 18, maxSpeed: 4, minAlpha: 0.02, name: 'reliefUpdate'})
Members
channel.luminance— The color's brightness, 0 black to 1 white.channel.luminanceInverted— One minus the brightness, so dark areas rise.channel.red— The red channel.channel.green— The green channel.channel.blue— The blue channel.channel.saturation— How colorful the pixel is, 0 grey to 1 pure.channel.alpha— The pixel's alpha.channel.byMode— The same seven by a select prop's number: 0 luminance, 1 inverted, 2 red, 3 green, 4 blue, 5 saturation, 6 alpha.
See also
integrator— The update step of an agent simulation: one per kind of agent.