Rainbow Theme V3

Original: https://github.com/haykam821/Diep.io-Rainbow-Fade

  1. // ==UserScript==
  2. // @name Rainbow Theme V3
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description Original: https://github.com/haykam821/Diep.io-Rainbow-Fade
  6. // @author haykam821 (edited by endless)
  7. // @match *://diep.io/
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. 'use strict';
  12.  
  13. (() => {
  14. let _fill = CanvasRenderingContext2D.prototype.fill;
  15.  
  16. // https://github.com/shlongisdookielol/shlongScripts/blob/main/Diep.io%20Glow
  17. CanvasRenderingContext2D.prototype.fill = function (args) {
  18. this.strokeStyle = this.fillStyle;
  19. this.shadowColor = this.fillStyle;
  20.  
  21. this.shadowBlur = 20;
  22. this.stroke();
  23.  
  24. this.fillStyle = "transparent";
  25. this.lineWidth = 7.5;
  26.  
  27. _fill.apply(this, args);
  28. };
  29.  
  30. const script = document.createElement("script");
  31. script.src = "https://cdnjs.cloudflare.com/ajax/libs/chroma-js/1.3.7/chroma.min.js";
  32. document.head.append(script);
  33.  
  34. script.addEventListener('load', () => {
  35. const colors = chroma.scale(['red', 'orange', 'yellow', 'lime', 'cyan', 'mediumpurple', 'red']).colors(1000);
  36. let index = 0;
  37.  
  38. setInterval(() => {
  39. index += 1;
  40.  
  41. if (index > colors.length) index = 0;
  42.  
  43. const scale = "0x" + colors[index].substr(1, Infinity);
  44.  
  45. const black = [ 0, 1, 8, 9, 10, 11, 13, 14, 16, 17 ]
  46.  
  47. black.forEach(function(i) {
  48. input.execute(`net_replace_color ${i} 0x000000`);
  49. });
  50.  
  51. black.splice(0, black.length, ...[
  52. 'ren_score_bar_fill_color',
  53. 'ren_xp_bar_fill_color',
  54. 'ren_health_fill_color',
  55. 'ren_background_color'
  56. ]);
  57.  
  58. black.forEach(function(i) {
  59. input.execute(i + ' 0x000000');
  60. });
  61.  
  62. input.set_convar(`ren_stroke_soft_color`, false);
  63. input.set_convar(`ren_raw_health_values`, true);
  64. input.execute(`ren_border_color 0xc7c7c7`);
  65.  
  66. var rainbow = [
  67. 'net_replace_color 12',
  68. 'net_replace_color 2',
  69. 'net_replace_color 15',
  70. 'ren_stroke_solid_color',
  71. 'ren_bar_background_color',
  72. 'ren_health_background_color',
  73. 'ren_minimap_background_color'
  74. ];
  75.  
  76. rainbow.forEach(function(i) {
  77. input.execute(i + ' ' + scale);
  78. });
  79.  
  80. input.execute(`ui_replace_colors` + ` ${scale}`.repeat(8));
  81. });
  82. });
  83. })();