Each of the sides and the diagonals of a regular square are randomly and independently colored red, blue, or green with equal probability. What is the probability that there will be a triangle whose vertices are among the vertices of the square such that all of its sides have the same color?