Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug 9c63e7] SSA: set the default color to white & swap red/blue channels #7

Closed
Gorrrg opened this issue Mar 16, 2017 · 2 comments
Closed

Comments

@Gorrrg
Copy link
Contributor

Gorrrg commented Mar 16, 2017

if color is None:
                color = '000000'

Gives me black text with a black border in MPC-HC. Should be color = 'FFFFFF' -> white text with black border.

Also RED/BLUE must be byteswapped, i.e. reverse the order of the three bytes: RGB -> BGR (ssa uses BGR it seems).

@Gorrrg Gorrrg changed the title [bug] SSA: set the default color to white [bug] SSA: set the default color to white & swap red/blue channels Mar 16, 2017
@Gorrrg Gorrrg changed the title [bug] SSA: set the default color to white & swap red/blue channels [bug 9c63e7] SSA: set the default color to white & swap red/blue channels Mar 16, 2017
@Gorrrg
Copy link
Contributor Author

Gorrrg commented Mar 16, 2017

I fixed the RGB/BGR issue for myself. First I copypasted a function I found on the web that solved this exact problem, and seemed to be decent without any type conversion:

def rev(a):
    new = ""

    for x in range(-1, -len(a), -2):
        new += a[x-1] + a[x]

    return new

+added a line to the SSA section calling the reverse function and also changed the default color to white.

            if color is None:
                color = 'FFFFFF'
            else:
                color = color.replace('#', '')
                color = rev(color)

Haven't tested it extensively but by looking at the SSA file it seems to be ok.

@Gorrrg
Copy link
Contributor Author

Gorrrg commented Mar 16, 2017

your byteswap looks much more reasonable lol, the function was for arbitrary numbers of bytes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant