@@ -10,88 +10,65 @@ export const CAPTION_TEXT_SIZE_OPTIONS: CaptionTextSize[] = [
1010 'large' ,
1111]
1212
13- export type CaptionFontColor =
13+ export type CaptionColor =
14+ | 'default'
1415 | 'white'
15- | 'yellow'
16+ | 'black'
17+ | 'blue'
1618 | 'green'
19+ | 'red'
20+ | 'yellow'
1721 | 'cyan'
18- | 'blue'
1922 | 'magenta'
20- | 'red'
21- | 'black'
2223
23- export const CAPTION_FONT_COLOR_OPTIONS : CaptionFontColor [ ] = [
24+ export const CAPTION_COLOR_OPTIONS : CaptionColor [ ] = [
25+ 'default' ,
2426 'white' ,
25- 'yellow' ,
27+ 'black' ,
28+ 'blue' ,
2629 'green' ,
30+ 'red' ,
31+ 'yellow' ,
2732 'cyan' ,
28- 'blue' ,
2933 'magenta' ,
30- 'red' ,
31- 'black' ,
3234]
3335
34- export const CAPTION_FONT_COLOR_VALUES : Record < CaptionFontColor , string > = {
36+ export const CAPTION_FONT_COLOR_VALUES : Record < CaptionColor , string > = {
37+ default : '#FFFFFF' ,
3538 white : '#FFFFFF' ,
36- yellow : '#FFFF00' ,
39+ black : '#000000' ,
40+ blue : '#0000FF' ,
3741 green : '#00FF00' ,
42+ red : '#FF0000' ,
43+ yellow : '#FFFF00' ,
3844 cyan : '#00FFFF' ,
39- blue : '#0000FF' ,
4045 magenta : '#FF00FF' ,
41- red : '#FF0000' ,
42- black : '#000000' ,
4346}
4447
45- export type CaptionBackgroundColor =
46- | 'black'
47- | 'white'
48- | 'red'
49- | 'green'
50- | 'blue'
51- | 'yellow'
52- | 'cyan'
53- | 'magenta'
54- | 'transparent'
55-
56- export const CAPTION_BACKGROUND_COLOR_OPTIONS : CaptionBackgroundColor [ ] = [
57- 'black' ,
58- 'white' ,
59- 'red' ,
60- 'green' ,
61- 'blue' ,
62- 'yellow' ,
63- 'cyan' ,
64- 'magenta' ,
65- 'transparent' ,
66- ]
67-
68- export const CAPTION_BACKGROUND_COLOR_VALUES : Record <
69- CaptionBackgroundColor ,
70- string
71- > = {
48+ export const CAPTION_BACKGROUND_COLOR_VALUES : Record < CaptionColor , string > = {
49+ default : 'rgba(0, 0, 0, 0.75)' ,
7250 black : 'rgba(0, 0, 0, 0.75)' ,
7351 white : 'rgba(255, 255, 255, 0.75)' ,
74- red : 'rgba(255, 0, 0, 0.75)' ,
75- green : 'rgba(0, 255, 0, 0.75)' ,
7652 blue : 'rgba(0, 0, 255, 0.75)' ,
53+ green : 'rgba(0, 255, 0, 0.75)' ,
54+ red : 'rgba(255, 0, 0, 0.75)' ,
7755 yellow : 'rgba(255, 255, 0, 0.75)' ,
7856 cyan : 'rgba(0, 255, 255, 0.75)' ,
7957 magenta : 'rgba(255, 0, 255, 0.75)' ,
80- transparent : 'transparent' ,
8158}
8259
8360type AccessibilityState = {
8461 announceReactions : boolean
8562 captionTextSize : CaptionTextSize
86- captionFontColor : CaptionFontColor
87- captionBackgroundColor : CaptionBackgroundColor
63+ captionFontColor : CaptionColor
64+ captionBackgroundColor : CaptionColor
8865}
8966
9067const DEFAULT_STATE : AccessibilityState = {
9168 announceReactions : false ,
9269 captionTextSize : 'medium' ,
93- captionFontColor : 'white ' ,
94- captionBackgroundColor : 'black ' ,
70+ captionFontColor : 'default ' ,
71+ captionBackgroundColor : 'default ' ,
9572}
9673
9774function getAccessibilityState ( ) : AccessibilityState {
@@ -104,17 +81,16 @@ function getAccessibilityState(): AccessibilityState {
10481 )
10582 ? parsed . captionTextSize
10683 : DEFAULT_STATE . captionTextSize
107- const captionFontColor = CAPTION_FONT_COLOR_OPTIONS . includes (
84+ const captionFontColor = CAPTION_COLOR_OPTIONS . includes (
10885 parsed . captionFontColor
10986 )
11087 ? parsed . captionFontColor
11188 : DEFAULT_STATE . captionFontColor
112- const captionBackgroundColor =
113- CAPTION_BACKGROUND_COLOR_OPTIONS . includes (
114- parsed . captionBackgroundColor
115- )
116- ? parsed . captionBackgroundColor
117- : DEFAULT_STATE . captionBackgroundColor
89+ const captionBackgroundColor = CAPTION_COLOR_OPTIONS . includes (
90+ parsed . captionBackgroundColor
91+ )
92+ ? parsed . captionBackgroundColor
93+ : DEFAULT_STATE . captionBackgroundColor
11894 return {
11995 ...DEFAULT_STATE ,
12096 ...parsed ,
0 commit comments