-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Extend the constructColor function to handle 6 digit hex codes #5238
Extend the constructColor function to handle 6 digit hex codes #5238
Conversation
nice, thanks. @gkatsev could you take a look please if you could include this |
I'd like to see unit tests on this, to verify that both color formats work. I've got some work coming up in this same area, and I'd need to merge it with this change, so I'd want to make sure that I didn't break anything in the merge. |
@OwenEdwards tests added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the rest of the code base not using switches, this looks good to me.
@gkatsev is there a downside to |
You definitely have to be more careful with switches due to their auto fall through and default case. |
Also, it doesn't match the rest of our code :) |
I find switch statements cleaner than a lot of else ifs for the same variable, but will change it if you want. |
@gkatsev ping. |
I think I would prefer it to be if statements over a switch for consistency. |
@gkatsev updated. |
Thanks @practual |
…e 6 digit hex codes (#5238) When providing the TextTrackDisplay component with track settings overrides, currently colour codes with only three digits are supported. This updates it so that 6 digit hex codes are also accepted.
Description
When providing the TextTrackDisplay component with track settings overrides, currently colour codes with only three digits are supported. I would like to make this more flexible by also allowing six digit hex codes.
CC @arski
Specific Changes proposed
Updates the TextTrackDisplay component's
constructColor
function to accept and process both three and six digit colour codes.Requirements Checklist