@@ -59,89 +59,222 @@ it("Successfully parse color options", () => {
5959
6060 const expected : ColorOption [ ] = [
6161 {
62- "colorOptionName" : "--name1-name2-111" ,
63- "themePath" : [ "name1Name2" , "_111" , "default" ] ,
64- "color" : "#000000"
62+ colorOptionName : "--name1-name2-111" ,
63+ themePath : [ "name1Name2" , "_111" , "default" ] ,
64+ color : "#000000" ,
65+ parsedColorOptionName : {
66+ colorName : "name1Name2" ,
67+ brightness : { isInvariant : true , value : 111 , variant : undefined } ,
68+ state : undefined
69+ }
6570 } ,
6671 {
67- "colorOptionName" : "--name1-name2-111-hover" ,
68- "themePath" : [ "name1Name2" , "_111" , "hover" ] ,
69- "color" : "#000001"
72+ colorOptionName : "--name1-name2-111-hover" ,
73+ themePath : [ "name1Name2" , "_111" , "hover" ] ,
74+ color : "#000001" ,
75+ parsedColorOptionName : {
76+ colorName : "name1Name2" ,
77+ brightness : { isInvariant : true , value : 111 , variant : undefined } ,
78+ state : "hover"
79+ }
7080 } ,
7181 {
72- "colorOptionName" : "--name1-name2-sun-111" ,
73- "themePath" : [ "name1Name2" , "sun111" , "default" ] ,
74- "color" : "#000002"
82+ colorOptionName : "--name1-name2-sun-111" ,
83+ themePath : [ "name1Name2" , "sun111" , "default" ] ,
84+ color : "#000002" ,
85+ parsedColorOptionName : {
86+ colorName : "name1Name2" ,
87+ brightness : { isInvariant : true , value : 111 , variant : "sun" } ,
88+ state : undefined
89+ }
7590 } ,
7691 {
77- "colorOptionName" : "--name1-name2-sun-111-hover" ,
78- "themePath" : [ "name1Name2" , "sun111" , "hover" ] ,
79- "color" : "#000003"
92+ colorOptionName : "--name1-name2-sun-111-hover" ,
93+ themePath : [ "name1Name2" , "sun111" , "hover" ] ,
94+ color : "#000003" ,
95+ parsedColorOptionName : {
96+ colorName : "name1Name2" ,
97+ brightness : { isInvariant : true , value : 111 , variant : "sun" } ,
98+ state : "hover"
99+ }
80100 } ,
81101 {
82- "colorOptionName" : "--name1-name2-111-222" ,
83- "themePath" : [ "name1Name2" , "_111_222" , "default" ] ,
84- "color" : { "light" : "#000004" , "dark" : "#100000" }
102+ colorOptionName : "--name1-name2-111-222" ,
103+ themePath : [ "name1Name2" , "_111_222" , "default" ] ,
104+ color : { light : "#000004" , dark : "#100000" } ,
105+ parsedColorOptionName : {
106+ colorName : "name1Name2" ,
107+ brightness : {
108+ isInvariant : false ,
109+ light : { value : 111 , variant : undefined } ,
110+ dark : { value : 222 , variant : undefined }
111+ } ,
112+ state : undefined
113+ }
85114 } ,
86115 {
87- "colorOptionName" : "--name1-name2-111-222-hover" ,
88- "themePath" : [ "name1Name2" , "_111_222" , "hover" ] ,
89- "color" : { "light" : "#000005" , "dark" : "#200000" }
116+ colorOptionName : "--name1-name2-111-222-hover" ,
117+ themePath : [ "name1Name2" , "_111_222" , "hover" ] ,
118+ color : { light : "#000005" , dark : "#200000" } ,
119+ parsedColorOptionName : {
120+ colorName : "name1Name2" ,
121+ brightness : {
122+ isInvariant : false ,
123+ light : { value : 111 , variant : undefined } ,
124+ dark : { value : 222 , variant : undefined }
125+ } ,
126+ state : "hover"
127+ }
90128 } ,
91129 {
92- "colorOptionName" : "--name1-name2-sun-111-222" ,
93- "themePath" : [ "name1Name2" , "sun111_222" , "default" ] ,
94- "color" : { "light" : "#000006" , "dark" : "#300000" }
130+ colorOptionName : "--name1-name2-sun-111-222" ,
131+ themePath : [ "name1Name2" , "sun111_222" , "default" ] ,
132+ color : { light : "#000006" , dark : "#300000" } ,
133+ parsedColorOptionName : {
134+ colorName : "name1Name2" ,
135+ brightness : {
136+ isInvariant : false ,
137+ light : { value : 111 , variant : "sun" } ,
138+ dark : { value : 222 , variant : undefined }
139+ } ,
140+ state : undefined
141+ }
95142 } ,
96143 {
97- "colorOptionName" : "--name1-name2-sun-111-222-hover" ,
98- "themePath" : [ "name1Name2" , "sun111_222" , "hover" ] ,
99- "color" : { "light" : "#000007" , "dark" : "#400000" }
144+ colorOptionName : "--name1-name2-sun-111-222-hover" ,
145+ themePath : [ "name1Name2" , "sun111_222" , "hover" ] ,
146+ color : { light : "#000007" , dark : "#400000" } ,
147+ parsedColorOptionName : {
148+ colorName : "name1Name2" ,
149+ brightness : {
150+ isInvariant : false ,
151+ light : { value : 111 , variant : "sun" } ,
152+ dark : { value : 222 , variant : undefined }
153+ } ,
154+ state : "hover"
155+ }
100156 } ,
101157 {
102- "colorOptionName" : "--name1-name2-111-moon-222" ,
103- "themePath" : [ "name1Name2" , "_111moon222" , "default" ] ,
104- "color" : { "light" : "#000008" , "dark" : "#500000" }
158+ colorOptionName : "--name1-name2-111-moon-222" ,
159+ themePath : [ "name1Name2" , "_111moon222" , "default" ] ,
160+ color : { light : "#000008" , dark : "#500000" } ,
161+ parsedColorOptionName : {
162+ colorName : "name1Name2" ,
163+ brightness : {
164+ isInvariant : false ,
165+ light : { value : 111 , variant : undefined } ,
166+ dark : { value : 222 , variant : "moon" }
167+ } ,
168+ state : undefined
169+ }
105170 } ,
106171 {
107- "colorOptionName" : "--name1-name2-111-moon-222-hover" ,
108- "themePath" : [ "name1Name2" , "_111moon222" , "hover" ] ,
109- "color" : { "light" : "#000009" , "dark" : "#600000" }
172+ colorOptionName : "--name1-name2-111-moon-222-hover" ,
173+ themePath : [ "name1Name2" , "_111moon222" , "hover" ] ,
174+ color : { light : "#000009" , dark : "#600000" } ,
175+ parsedColorOptionName : {
176+ colorName : "name1Name2" ,
177+ brightness : {
178+ isInvariant : false ,
179+ light : { value : 111 , variant : undefined } ,
180+ dark : { value : 222 , variant : "moon" }
181+ } ,
182+ state : "hover"
183+ }
110184 } ,
111185 {
112- "colorOptionName" : "--name1-name2-sun-111-moon-222" ,
113- "themePath" : [ "name1Name2" , "sun111moon222" , "default" ] ,
114- "color" : { "light" : "#00000a" , "dark" : "#700000" }
186+ colorOptionName : "--name1-name2-sun-111-moon-222" ,
187+ themePath : [ "name1Name2" , "sun111moon222" , "default" ] ,
188+ color : { light : "#00000a" , dark : "#700000" } ,
189+ parsedColorOptionName : {
190+ colorName : "name1Name2" ,
191+ brightness : {
192+ isInvariant : false ,
193+ light : { value : 111 , variant : "sun" } ,
194+ dark : { value : 222 , variant : "moon" }
195+ } ,
196+ state : undefined
197+ }
115198 } ,
116199 {
117- "colorOptionName" : "--name1-name2-sun-111-moon-222-hover" ,
118- "themePath" : [ "name1Name2" , "sun111moon222" , "hover" ] ,
119- "color" : { "light" : "#00000b" , "dark" : "#800000" }
200+ colorOptionName : "--name1-name2-sun-111-moon-222-hover" ,
201+ themePath : [ "name1Name2" , "sun111moon222" , "hover" ] ,
202+ color : { light : "#00000b" , dark : "#800000" } ,
203+ parsedColorOptionName : {
204+ colorName : "name1Name2" ,
205+ brightness : {
206+ isInvariant : false ,
207+ light : { value : 111 , variant : "sun" } ,
208+ dark : { value : 222 , variant : "moon" }
209+ } ,
210+ state : "hover"
211+ }
120212 } ,
121213 {
122- "colorOptionName" : "--grey-1000-50-hover" ,
123- "themePath" : [ "grey" , "_1000_50" , "hover" ] ,
124- "color" : { "light" : "#00000c" , "dark" : "#900000" }
214+ colorOptionName : "--grey-1000-50-hover" ,
215+ themePath : [ "grey" , "_1000_50" , "hover" ] ,
216+ color : { light : "#00000c" , dark : "#900000" } ,
217+ parsedColorOptionName : {
218+ colorName : "grey" ,
219+ brightness : {
220+ isInvariant : false ,
221+ light : { value : 1000 , variant : undefined } ,
222+ dark : { value : 50 , variant : undefined }
223+ } ,
224+ state : "hover"
225+ }
125226 } ,
126227 {
127- "colorOptionName" : "--blue-france-sun-113-625" ,
128- "themePath" : [ "blueFrance" , "sun113_625" , "default" ] ,
129- "color" : { "light" : "#00000d" , "dark" : "#a00000" }
228+ colorOptionName : "--blue-france-sun-113-625" ,
229+ themePath : [ "blueFrance" , "sun113_625" , "default" ] ,
230+ color : { light : "#00000d" , dark : "#a00000" } ,
231+ parsedColorOptionName : {
232+ colorName : "blueFrance" ,
233+ brightness : {
234+ isInvariant : false ,
235+ light : { value : 113 , variant : "sun" } ,
236+ dark : { value : 625 , variant : undefined }
237+ } ,
238+ state : undefined
239+ }
130240 } ,
131241 {
132- "colorOptionName" : "--blue-france-sun-113-625-active" ,
133- "themePath" : [ "blueFrance" , "sun113_625" , "active" ] ,
134- "color" : { "light" : "#00000e" , "dark" : "#b00000" }
242+ colorOptionName : "--blue-france-sun-113-625-active" ,
243+ themePath : [ "blueFrance" , "sun113_625" , "active" ] ,
244+ color : { light : "#00000e" , dark : "#b00000" } ,
245+ parsedColorOptionName : {
246+ colorName : "blueFrance" ,
247+ brightness : {
248+ isInvariant : false ,
249+ light : { value : 113 , variant : "sun" } ,
250+ dark : { value : 625 , variant : undefined }
251+ } ,
252+ state : "active"
253+ }
135254 } ,
136255 {
137- "colorOptionName" : "--blue-france-main-525" ,
138- "themePath" : [ "blueFrance" , "main525" , "default" ] ,
139- "color" : "#00000f"
256+ colorOptionName : "--blue-france-main-525" ,
257+ themePath : [ "blueFrance" , "main525" , "default" ] ,
258+ color : "#00000f" ,
259+ parsedColorOptionName : {
260+ colorName : "blueFrance" ,
261+ brightness : { isInvariant : true , value : 525 , variant : "main" } ,
262+ state : undefined
263+ }
140264 } ,
141265 {
142- "colorOptionName" : "--purple-glycine-sun-319-moon-630-hover" ,
143- "themePath" : [ "purpleGlycine" , "sun319moon630" , "hover" ] ,
144- "color" : { "light" : "#000010" , "dark" : "#c00000" }
266+ colorOptionName : "--purple-glycine-sun-319-moon-630-hover" ,
267+ themePath : [ "purpleGlycine" , "sun319moon630" , "hover" ] ,
268+ color : { light : "#000010" , dark : "#c00000" } ,
269+ parsedColorOptionName : {
270+ colorName : "purpleGlycine" ,
271+ brightness : {
272+ isInvariant : false ,
273+ light : { value : 319 , variant : "sun" } ,
274+ dark : { value : 630 , variant : "moon" }
275+ } ,
276+ state : "hover"
277+ }
145278 }
146279 ] ;
147280
0 commit comments