Greasy Fork is available in English.

YouTube Chat Color Names

Make YouTube Chat Color Names

  1. /* ==UserStyle==
  2. @name YouTube Chat Color Names
  3. @version 0.1.0
  4. @namespace github.com/cyfung1031
  5. @license MIT
  6. @description Make YouTube Chat Color Names
  7. @author CY Fung
  8. @preprocessor stylus
  9.  
  10.  
  11. ==/UserStyle== */
  12.  
  13. v-transparent = 1.0;
  14.  
  15. dummy()
  16. // dummy
  17. border: 0;
  18.  
  19.  
  20. cc(colorCode)
  21. transparentify(colorCode, v-transparent)
  22.  
  23. myChars = (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9)
  24.  
  25.  
  26. $colorList = #FF0000, #00FF00, #B22222,
  27. #FF7F50, #9ACD32, #FF4500,
  28. #2E8B57, #DAA520, #D2691E,
  29. #5F9EA0, #1E90FF, #FF69B4,
  30. #8A2BE2, #00FF7F
  31.  
  32. gen1()
  33. for c1, i in myChars
  34. d1 = '&:has(#img[src*="m/%s"])' % c1
  35. {d1}
  36. --author-color-x 'var(--atine-color-%s)' % (i+1+1000)
  37. for c1, i in myChars
  38. d1 = '&:has(#img[src*="%s="])' % c1
  39. {d1}
  40. --author-color-x 'var(--atine-color-%s)' % (i+1+1000)
  41.  
  42. $nLen = length(myChars)
  43. $kLen = $nLen + 2
  44. gen2()
  45. for $i in 1..$kLen
  46. $k = $i - 1
  47. $n = length($colorList)
  48. $color = $colorList[$k % $n] // Reuse colors cyclically
  49. {"--atine-color-" + ($i+1000)} cc($color)
  50. @-moz-document url-prefix("https://www.youtube.com/live_chat") {
  51.  
  52. html {
  53. gen2()
  54. --author-color-1-default: "var(--atine-color-%s)" % (1000 + $kLen);
  55. }
  56.  
  57.  
  58. .yt-live-chat-item-list-renderer {
  59. gen1()
  60. --author-color-x: var(--author-color-1-default);
  61. }
  62.  
  63. .yt-live-chat-item-list-renderer #author-name.style-scope.yt-live-chat-author-chip {
  64. color: var(--author-color-x);
  65. }
  66.  
  67. }