Material Colors - Color Ref

FULL SCREEN Material Colors (to be paired with Stylish styles)

  1. // ==UserScript==
  2. // @name Material Colors - Color Ref
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description FULL SCREEN Material Colors (to be paired with Stylish styles)
  6. // @author Brandon McConnell
  7. // @match https://www.materialui.co/colors
  8. // @grant none
  9. // @require http://code.jquery.com/jquery-3.2.1.min.js
  10. // ==/UserScript==
  11.  
  12. $(document).ready(function() {
  13. var hexcode = '#ffffff';
  14. $('td[data-hashhex]').on( "click", function() {
  15. hexcode = $(this).attr("data-hashhex");
  16. setTimeout(function(){
  17. $('.notification').css('background', hexcode);
  18. $('.notification__text').html(hexcode);
  19. }, 10);
  20. console.log(hexcode);
  21. });
  22. $('td[data-hex]').each(function() {
  23. var hexcodeLink = "http://www.colorhexa.com/"+$(this).attr("data-hex").toLowerCase();
  24. $(this).find('a').attr('href', hexcodeLink);
  25. });
  26. });