update colors

This commit is contained in:
2026-03-03 18:03:59 +08:00
parent 8e73ea7128
commit 6153d386e7
5 changed files with 23 additions and 18 deletions

4
.gitignore vendored
View File

@@ -43,6 +43,10 @@ uv.lock
*~ *~
.DS_Store .DS_Store
# node
node_modules/
package-lock.json
# Project specific - Input/Output files # Project specific - Input/Output files
*.mp4 *.mp4
*.mov *.mov

View File

@@ -1,9 +1,8 @@
{ {
"Malabar": "#FFD700", "Malabar": "#000000",
"Song": "#87CEEB", "Song": "#4682B4",
"Star": "#FFFFFF", "Moon": "#A9A9A9",
"Moon": "#C0C0C0",
"Jupiter": "#D2691E", "Jupiter": "#D2691E",
"Volcanoes": "#8B0000", "Volcanoes": "#8B0000",
"Earth": "#228B22" "Earth": "#228B22"
} }

View File

@@ -37,7 +37,7 @@ OUTPUT_FILE = Path("_colors.json")
# Fixed color assignments # Fixed color assignments
FIXED_COLORS = { FIXED_COLORS = {
"Malabar": "#FFD700" # Gold "Malabar": "#000000" # Black
} }
# Default configurations for different providers # Default configurations for different providers
@@ -119,17 +119,19 @@ Speakers to assign colors:
Color assignment guidelines (use hex codes like #FF0000): Color assignment guidelines (use hex codes like #FF0000):
- Mars → #CD5C5C (red planet) or #FF4500 - Mars → #CD5C5C (red planet) or #FF4500
- Earth → #228B22 (forest green) or #4169E1 (royal blue) - Earth → #228B22 (forest green) or #4169E1 (royal blue)
- Moon → #C0C0C0 (silver) or #A9A9A9 (dark gray) - Moon → #A9A9A9 (dark gray) - avoid light colors
- Sun → #FFD700 (gold) or #FFA500 (orange) - Sun → #FFA500 (orange) - avoid light colors
- Jupiter → #D2691E (chocolate/orange) - Jupiter → #D2691E (chocolate/orange)
- Galaxy → #9370DB (medium purple) or #FF69B4 (hot pink) - Galaxy → #9370DB (medium purple) or #FF69B4 (hot pink)
- Star → #FFFFFF (white) or #FFFACD (lemon chiffon) - Star → #DAA520 (goldenrod) or #B8860B (dark goldenrod) - avoid white/light colors
- Volcano → #8B0000 (dark red) or #FF4500 (orange red) - Volcano → #8B0000 (dark red) or #FF4500 (orange red)
- Kangaroo/Giraffe → #D2B48C (tan) or #F4A460 (sandy brown) - Kangaroo/Giraffe → #D2691E (chocolate) or #8B4513 (saddle brown)
- Song → #87CEEB (sky blue) or #DDA0DD (plum) - Song → #4682B4 (steel blue) or #9370DB (medium purple) - avoid light colors
IMPORTANT: Do NOT use light colors like #FFFFFF (white), #FFFACD, #87CEEB, #C0C0C0. All colors must be dark enough to read on white backgrounds.
Fixed assignment: Fixed assignment:
- Malabar → #FFD700 (gold, already set) - Malabar → #000000 (black, already set)
Reply with ONLY a JSON object mapping speaker names to hex color codes: Reply with ONLY a JSON object mapping speaker names to hex color codes:
{{"SpeakerName": "#RRGGBB", ...}} {{"SpeakerName": "#RRGGBB", ...}}
@@ -175,19 +177,19 @@ JSON:"""
elif 'earth' in name_lower: elif 'earth' in name_lower:
color_mapping[speaker] = "#228B22" # Forest green color_mapping[speaker] = "#228B22" # Forest green
elif 'moon' in name_lower: elif 'moon' in name_lower:
color_mapping[speaker] = "#C0C0C0" # Silver color_mapping[speaker] = "#A9A9A9" # Dark gray
elif 'sun' in name_lower: elif 'sun' in name_lower:
color_mapping[speaker] = "#FFD700" # Gold color_mapping[speaker] = "#FFA500" # Orange
elif 'jupiter' in name_lower: elif 'jupiter' in name_lower:
color_mapping[speaker] = "#D2691E" # Chocolate/orange color_mapping[speaker] = "#D2691E" # Chocolate/orange
elif 'star' in name_lower: elif 'star' in name_lower:
color_mapping[speaker] = "#FFFFFF" # White color_mapping[speaker] = "#DAA520" # Goldenrod
elif 'galaxy' in name_lower: elif 'galaxy' in name_lower:
color_mapping[speaker] = "#9370DB" # Medium purple color_mapping[speaker] = "#9370DB" # Medium purple
elif 'volcano' in name_lower: elif 'volcano' in name_lower:
color_mapping[speaker] = "#8B0000" # Dark red color_mapping[speaker] = "#8B0000" # Dark red
elif 'song' in name_lower: elif 'song' in name_lower:
color_mapping[speaker] = "#87CEEB" # Sky blue color_mapping[speaker] = "#4682B4" # Steel blue
else: else:
color_mapping[speaker] = "#808080" # Gray color_mapping[speaker] = "#808080" # Gray

View File

@@ -9,7 +9,7 @@
data-chinese="{{ line.chinese | escape }}" data-chinese="{{ line.chinese | escape }}"
data-timestamp="{{ line.timestamp }}" data-timestamp="{{ line.timestamp }}"
data-speaker="{{ line.speaker }}"> data-speaker="{{ line.speaker }}">
<div class="english" {% if line.speaker in colors %}style="color: {{ colors[line.speaker] }}"{% endif %}> <div class="english" style="color: {{ colors.get(line.speaker, '#777777') }}">
{{ line.english }} {{ line.english }}
</div> </div>
</div> </div>

View File

@@ -34,7 +34,7 @@
data-chinese="<%= escapeHtml(line.chinese) %>" data-chinese="<%= escapeHtml(line.chinese) %>"
data-timestamp="<%= escapeHtml(line.timestamp) %>" data-timestamp="<%= escapeHtml(line.timestamp) %>"
data-speaker="<%= escapeHtml(line.speaker) %>"> data-speaker="<%= escapeHtml(line.speaker) %>">
<div class="english" style="<%= colors[line.speaker] ? `color: ${colors[line.speaker]}` : '' %>"> <div class="english" style="color: <%= colors[line.speaker] || '#777777' %>">
<%= line.english %> <%= line.english %>
</div> </div>
</div> </div>