function areArraysEqual(array1, array2) {
    if (!Array.isArray(array1) || !Array.isArray(array2)) {
        return false;
    }
    if (array1.length !== array2.length) {
        return false;
    }
    for (var i = 0; i < array1.length; ++i) {
        if (array1[i] !== array2[i]) {
            return false;
        }
    }
    return true;
}
Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.
This version can also convert array of colors
@private
@param array1 - First array to compare
@param array2 - Second array to compare
@return Do the arrays contain the same values in the same order