🏠 Home 

Rainbow border for flowgame.io

u can change the speed here (function() {var speed = 5; have fun with the script flow players!


Install this script?
  1. // ==UserScript==
  2. // @name Rainbow border for flowgame.io
  3. // @namespace http://tampermonkey.net/
  4. // @version 3
  5. // @description u can change the speed here (function() {var speed = 5; have fun with the script flow players!
  6. // @author Sakuro
  7. // @match *://*.flowgame.io/
  8. // @match *://*.flowy.gg/*
  9. // @license MIT
  10. // @grant document-start
  11. // ==/UserScript==
  12. if (window.flowExtensions) {
  13. window.flowExtensions.register('https://greasyfork.org/en/scripts/442172-rainbow-border');
  14. }
  15. var rainbowMode = true;
  16. var borderColor = '#FFFFFF';
  17. // --- --- --- --- --- --- ---
  18. (function() {
  19. var speed = 5;
  20. function hslToHex(h, s, l) {
  21. h /= 360;
  22. s /= 100;
  23. l /= 100;
  24. let r, g, b;
  25. if (s === 0) {
  26. r = g = b = l;
  27. } else {
  28. const hue2rgb = (p, q, t) => {
  29. if (t < 0) t += 1;
  30. if (t > 1) t -= 1;
  31. if (t < 1 / 6) return p + (q - p) * 6 * t;
  32. if (t < 1 / 2) return q;
  33. if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
  34. return p;
  35. };
  36. const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
  37. const p = 2 * l - q;
  38. r = hue2rgb(p, q, h + 1 / 3);
  39. g = hue2rgb(p, q, h);
  40. b = hue2rgb(p, q, h - 1 / 3);
  41. }
  42. const toHex = x => {
  43. const hex = Math.round(x * 255).toString(16);
  44. return hex.length === 1 ? '0' + hex : hex;
  45. };
  46. return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
  47. }
  48. var stroke = CanvasRenderingContext2D.prototype.stroke;
  49. CanvasRenderingContext2D.prototype.stroke = function(){
  50. if(this.lineWidth < 0 || this.strokeStyle == "#ffffff" || this.strokeStyle == "#333333" || this.strokeStyle == "#7f7f7f" || this.strokeStyle.slice(5,7) != this.strokeStyle.slice(3,5)) return stroke.apply(this, arguments);
  51. this.strokeStyle = rainbowMode ? hslToHex(Math.floor(Date.now() / speed) % 360, 100, 50) : borderColor;
  52. return stroke.apply(this, arguments);
  53. }
  54. })();