config.ts 839 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import env from './core/env';
  2. let dpr = 1;
  3. // If in browser environment
  4. if (env.hasGlobalWindow) {
  5. dpr = Math.max(
  6. window.devicePixelRatio
  7. || (window.screen && (window.screen as any).deviceXDPI / (window.screen as any).logicalXDPI)
  8. || 1, 1
  9. );
  10. }
  11. /**
  12. * Debug log mode:
  13. * 0: Do nothing, for release.
  14. * 1: console.error, for debug.
  15. */
  16. export const debugMode = 0;
  17. // retina 屏幕优化
  18. export const devicePixelRatio = dpr;
  19. /**
  20. * Determine when to turn on dark mode based on the luminance of backgroundColor
  21. */
  22. export const DARK_MODE_THRESHOLD = 0.4;
  23. /**
  24. * Color of default dark label.
  25. */
  26. export const DARK_LABEL_COLOR = '#333';
  27. /**
  28. * Color of default light label.
  29. */
  30. export const LIGHT_LABEL_COLOR = '#ccc';
  31. /**
  32. * Color of default light label.
  33. */
  34. export const LIGHTER_LABEL_COLOR = '#eee';