You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

color.test.js 1.1KB

123456789101112131415161718192021
  1. import {useLightTextOnBackground} from './color.js';
  2. test('useLightTextOnBackground', () => {
  3. expect(useLightTextOnBackground(215, 58, 74)).toBe(true);
  4. expect(useLightTextOnBackground(0, 117, 202)).toBe(true);
  5. expect(useLightTextOnBackground(207, 211, 215)).toBe(false);
  6. expect(useLightTextOnBackground(162, 238, 239)).toBe(false);
  7. expect(useLightTextOnBackground(112, 87, 255)).toBe(true);
  8. expect(useLightTextOnBackground(0, 134, 114)).toBe(true);
  9. expect(useLightTextOnBackground(228, 230, 105)).toBe(false);
  10. expect(useLightTextOnBackground(216, 118, 227)).toBe(true);
  11. expect(useLightTextOnBackground(255, 255, 255)).toBe(false);
  12. expect(useLightTextOnBackground(43, 134, 133)).toBe(true);
  13. expect(useLightTextOnBackground(43, 135, 134)).toBe(true);
  14. expect(useLightTextOnBackground(44, 135, 134)).toBe(true);
  15. expect(useLightTextOnBackground(59, 182, 179)).toBe(true);
  16. expect(useLightTextOnBackground(124, 114, 104)).toBe(true);
  17. expect(useLightTextOnBackground(126, 113, 108)).toBe(true);
  18. expect(useLightTextOnBackground(129, 112, 109)).toBe(true);
  19. expect(useLightTextOnBackground(128, 112, 112)).toBe(true);
  20. });