     }
 
     if (hasColor) {
-        const bool isParticle = usingParticles && isPartOfParticle(time, gl_VertexID,
+        bool isParticle = usingParticles && isPartOfParticle(time, gl_VertexID,
                                                                     particleSize,
                                                                     particleSpeed,
                                                                     particleSpacing);

        }

        if (colorMethod == colorByQuantity) {
            const vec4 quantityColor = getTransferFunctionColor();
            vs_color = vec4(quantityColor.xyz, vs_color.a * quantityColor.a);
        }
    } else {


vec4 getTransferFunctionColor() {
    // Remap the color scalar to a [0,1] range
    float lookUpVal = (in_color_scalar - colorTableRange.x) /
                            (colorTableRange.y - colorTableRange.x);
    return texture(colorTable, lookUpVal);
}

bool isPartOfParticle(const double time, const int vertexId, const int particleSize,
                      const int particleSpeed, const int particleSpacing) {
    int modulusResult = int(double(particleSpeed) * time + vertexId) % particleSpacing;
    return modulusResult > 0 && modulusResult <= particleSize;
}

