import Color from '../types/Color';

/**
 * Returns true if the two colors are the same
 * @author Gabe Abrams
 * @param a first color
 * @param b second color
 * @returns true if colors are the same
 */
const colorsAreSame = (a: Color, b: Color): boolean => {
  // check if either is undefined
  if (!a || !b) {
    return false;
  }

  return (
    a.r === b.r
    && a.g === b.g
    && a.b === b.b
  );
};

export default colorsAreSame;
