Line an 8x8 inch baking dish with parchment paper, leaving some overhang for easy removal.
In a medium saucepan over low heat, combine the white chocolate chips, sweetened condensed milk, vanilla extract, and salt. Stir continuously until the mixture is smooth and fully melted, about 5-7 minutes.
Remove the saucepan from heat. Divide the mixture into three equal parts in separate bowls.
In one bowl, add a few drops of red food coloring and mix until you reach your desired shade.
In the second bowl, add blue food coloring and mix. Leave the third bowl plain.
Spoon the red mixture into the prepared baking dish and spread it evenly.
Add the plain white fudge mixture on top and spread it evenly.
Finally, add the blue mixture on top of the white layer and spread it out.
Sprinkle the red and blue M&M's and chopped walnuts (if using) evenly over the top and gently press them into the fudge.
Refrigerate for at least 2 hours or until firm. Once set, lift the fudge out of the dish using the parchment paper and cut into squares.