Skip to content

ColorList

The colors a spark or railgun particle blends through as it ages.

Specification
Applies to
ParticleType
File
rules.ini
Section
[<ObjectType ID>]
Value
rgbclass list
When omitted
(empty)
rules.ini
[MYSPARK] ; a ParticleType registered in [Particles]
BehavesLike=Spark
MaxEC=500
XVelocity=10
YVelocity=10
ZVelocityRange=15
ColorList=(255,255,255),(200,200,80),(200,10,10),(0,0,0)
ColorSpeed=.13

Each entry is a parenthesized red, green and blue triplet, and the parentheses are part of the grammar rather than decoration: the first character of every red component and the last character of every blue one are discarded before the numbers are converted. (255,255,255) therefore reads as white, while the same triplet written without brackets reads as 55,255,25. Values are counted off in threes from the start of the line regardless of where the brackets fall, so a triplet with a component missing shifts every color after it. Components are stored in one byte each, so 256 reads as 0 and 300 as 44.

Only the two behaviors that are plotted as a single lit pixel — Spark and Railgun — are drawn from the list. The particle holds a position between two neighboring entries and slides along it at ColorSpeed; the pixel put on screen is the mix of the two at that position. The first pair runs from the color picked out of StartColor1 and StartColor2 to the second entry, and thereafter from one entry to the next until the last pair, which is where the particle stays for the rest of its life. The pair is only fetched while the particle is being drawn, so a list too short to hold the pair costs nothing until one comes into view.