I have been lurking for a good while but this is my first actual post. So hopefully I haven't missed a million answers to my question(s) due to ineffective searching/forum scanning. While I am asking before finalizing how I want to lay out a project I am currently working on, I am extremely new to DIY electronics so I'd like to know the answer just for the sake of knowledge as well. This will actually be my first electronics project assuming I finish it!
So to lay out current project as a starting point. I am modding a PC case and I want to toy around with various lighting effects using LEDs. My current estimation will be something to the effect of 40 5mm RGB LEDs (cheapy version I am using for design/testing/prototype are common cathode with forward voltages estimated around 2.2/3.5/3.5v and forward current of 20mA). I am using an Uno for my initial testing and just throwing together various configs on a breadboard to see what works out the best. The power supply for these will be the 12V PSU that will be powering the PC itself (840W 70A on a single +12v rail).
Some additional information: I do not need individual control of each LED though I may set up separate "zones" of several LEDs. I am however controlling the color channels individually and I may add in a "dimming" function for the whole setup (though this will probably be done in software probably as a multiplier/offset for the adjustments for the individual color channels). While prototyping is being done with an UNO for ease of use, I will probably use a pro mini or something of that size for the final design.
Currently with my prototyping layout I am doing high side switching using 3 PWM outputs on the Uno to drive 3 NPN transistors that drive 3 PNP transistors that are switching 12VDC from a small "brick" style power supply to the anodes for each color channel. Each LED color channel is linked in parallel with like channels with an appropriately sized resistor on each anode (i.e. 5 LEDs = 3 color channels, 15 individual channels and 15 resistors in 3 sets of 5 linked in parallel). Everything is using the ground from the 12VDC PSU. In the final solution, I would essentially use the same design with slightly larger transistors, and possibly resistor networks instead of individual resistors to save on space.
NOW after over-explaining all of that my actual question is in how I "should" be powering these LEDs (or any device of a similar voltage/current for that matter) vs how I intend to.
For instance, instead of pushing 12V to my LEDs and adding resistors to drop it to an acceptable level for them to function, would it be better for me first to regulate the voltage in some way to something closer to what they are rated for across the board, and then switch that to them (with smaller resistors)?
I have looked around for answers to this and in most cases it seems like the answer is that a.) use resistors because they are inexpensive and simple and b.) because the wasted power is so minimal that it's not a bother.
If cost were not an issue what would be the "best" way to do it in terms of power efficiency, generated heat, efficient use of PCB space, etc? In my current project the power efficiency is not an issue, but I am limited on space and would prefer to generate as little heat as possible beyond what the LEDs already add to the equation. Future projects may require battery power and efficiency would be a HUGE plus there.
Hopefully this makes sense and I am asking the question correctly! Thanks!