gmertes / NflxMultiSubs

Bilingual Subtitles for the Netflix Web App. An actively maintained fork with various bugfixes and improvements to the original NflxMultiSubs.
MIT License
172 stars 23 forks source link

Added primary and secondary color settings #24

Closed cloetensbrecht closed 2 years ago

cloetensbrecht commented 2 years ago

I added a color picker to the settings window to define the color of the primary subtitles and to define the color for the secondary subtitles. By default both colors are set to white.

image

image

gmertes commented 2 years ago

Nice one, thanks!

I restyled the options page so that it still fits in the same window size without a scrollbar. What do you think? Not the best at css, so feel free to propose a change. image

There is one issue: the colour is not applied to the secondary subtitles when they are image based (e.g.: Chinese). The secondary image based subs are placed in an img tag inside an svg tag, and the fill or color properties don't work in this case. I tried using filter on the img tag with the code here and here but didn't get great results (colour accuracy was wrong). Need to investigate some more how to get around this , because I would like for the colour setting to also work on image based secondary subs before I merge this (help welcome!).

gmertes commented 2 years ago

I didn't find a way to correctly colour image-based subs yet, but I'm gonna go ahead and merge this one anyway while I keep looking. If I can't find a solution, I'll include this feature in the next release for text-based subs at least. Thanks again!

cloetensbrecht commented 2 years ago

Sorry @gmertes . I had a quick look at the image generated sub colors, but I need a little more time to check how these are working :) When I have the time I'll look at it again.

gmertes commented 2 years ago

@cloetensbrecht Sure np! The image-subs code lives in the ImageSubtitle and PrimaryImageTransformer classes. The part that's giving me issues is the black border around the SVG subs. The filter approach only works for single-colour SVGs. Since they are vector graphics maybe there is a way to isolate the stroke element, remove it, apply the filter, and then reapply the stroke?

If you do find a solution, another PR is welcome ;)