Im sorry I was referring to the PWM that is controlling the level of the LEDs. If the pins are acting as a path to ground, how is the PWM controlling the level of the LEDs?
The pwm output lets one change the duty cycle of the HIGH and LOW output switching such that the led will appear to have less 'effective' current as the duty cycle is reduced from 100% towards 0%. It's really your eye that is 'averaging' the light level, the instantaneous current is still either 0 ma or the current set by the resistor depending on the output state of the pwm pin at any instant of time.
And also, why are we using pins to send the current to ground? Why not just send connect the the LED to the ground after feeding in voltage through the 3 seperate LEDs? Is it because this is a common anode RGB LED? If it were a common cathod RGB LED, could I do it the way I described?
Yes, common anode or common cathode package configuration dictates what level has to be used for the common side of the leds.
Thank you again, I appreciate it. I apologize, I'm a bit confused at the moment.