user
Generate a algorithm to sort a given list of three colors.

Now complete the following instance -
Input: colors = ['white', 'red', 'blue']
Output:
assistant
def sort_colors(colors):
     """This function sorts a given list of colors according to their RGB values.
     
     Arguments:
         colors {list} -- A list of colors
     
     Returns:
         list -- The colors sorted according to their RGB values
     """
     colors.sort(key=lambda color: (color[0], color[2], color[1])) 
     return colors