Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. const colorLookup = {
  2. get: (target, attr) => {
  3. if (typeof target[attr] === 'object' && target[attr] !== null) {
  4. return new Proxy(target[attr], colorLookup);
  5. } else if (attr in target) {
  6. return target[attr];
  7. } else {
  8. return attr;
  9. }
  10. },
  11. };
  12.  
  13. const colorSchemes = {
  14. base: {
  15. white : 'white',
  16. transparentWhite: 'rgba(256, 256, 256, 0)',
  17. transparentBlack: 'rgba(0, 0, 0, 0)',
  18. },
  19. atlanta: {
  20. primary : '#C4C4C4',
  21. secondary: '#910F1B',
  22. tertiary : '#323232',
  23. },
  24. boston: {
  25. primary : '#174B97',
  26. secondary: '#EFDF00',
  27. tertiary : '#000000',
  28. },
  29. chengdue: {
  30. primary : '#FFA000',
  31. secondary: '#BF926A',
  32. tertiary : '#161823',
  33. },
  34. // the other 17 teams are listed out in the github repo
  35. };
  36.  
  37. export default new Proxy(colorSchemes, colorLookup);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement