Control RGB LEDS (common cathode) with a Mosfet or a transistor

will this work? the switch simulate the arduino and yes i know i need a resitor for the LED