Spaces:
Sleeping
Sleeping
File size: 1,838 Bytes
17e505a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | # Separate Creator Color Engine for Subtitles
# Color format used: ASS Hex Matrix Format &H00BBGGRR (Blue, Green, Red)
COLOR_PALETTE = {
"YELLOW": "&H0000FFFF", # Bright Creator Yellow
"GREEN": "&H0000FF00", # MrBeast Neon Green
"RED": "&H000000FF", # High-Impact Red
"PINK": "&H00CC00FF", # Viral Shock Pink
"WHITE": "&H00FFFFFF" # Base Fill White
}
def get_word_color(word_text, word_index):
clean_word = word_text.strip().upper().replace(",", "").replace(".", "").replace("!", "")
# π΄ Hardcoded Priority RED Words (Negative/High Impact)
if clean_word in ["STOP", "FREEZE", "WRONG", "BAD", "FAIL", "NO", "DON'T", "NEVER", "BUT", "HATE"]:
return COLOR_PALETTE["RED"]
# π’ Hardcoded Priority GREEN Words (Money/Value)
if clean_word in ["MONEY", "CASH", "WIN", "BEST", "PERFECT", "FAST", "SMART", "MAKE", "MAKING", "FREE", "RICH"]:
return COLOR_PALETTE["GREEN"]
# π‘ Hardcoded Priority YELLOW Words (Time/Action Hooks)
if clean_word in ["YOU", "NOW", "START", "NEED", "LOOK", "LISTEN", "THIS", "WAIT", "WATCH", "GO", "DO"]:
return COLOR_PALETTE["YELLOW"]
# π Hardcoded Priority PINK Words (Viral/Shock Hooks)
if clean_word in ["VIRAL", "INSANE", "SHOCKING", "SECRET", "WHAT", "CRAZY", "WOW", "AMAZING", "BROKE", "MYSTERY"]:
return COLOR_PALETTE["PINK"]
# π AUTOMATIC ROTATION ENGINE:
# If the word isn't in the priority lists, it automatically cycles colors
# so that almost every sentence is fully color-coded!
rotation_pool = [
COLOR_PALETTE["WHITE"],
COLOR_PALETTE["YELLOW"],
COLOR_PALETTE["GREEN"],
COLOR_PALETTE["PINK"],
COLOR_PALETTE["WHITE"],
COLOR_PALETTE["RED"]
]
return rotation_pool[word_index % len(rotation_pool)]
|