-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.js
121 lines (99 loc) · 6.35 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// const cc = require("./color-conversion.js")
// SOLARIZED RGB HSB
// --------- ----------- -----------
// base03 [ 0, 43, 54], hsl(192.22222222222223, 100%, 10.588235294117647%); hsl(192.22222222222223, 100%, 7.0588235294117645%);
// base02 [ 7, 54, 66], hsl(192.20338983050848, 80.82191780821917%, 14.31372549019608%); hsl(192.20338983050848, 80.82191780821917%, 9.54248366013072%);
// base01 [ 88, 110, 117], hsl(194.48275862068965, 14.146341463414632%, 40.19607843137255%); hsl(194.48275862068965, 14.146341463414632%, 26.797385620915033%);
// base00 [101, 123, 131], hsl(195.99999999999997, 12.93103448275862%, 45.49019607843137%); hsl(195.99999999999997, 12.93103448275862%, 30.32679738562091%);
// base0 [131, 148, 150], hsl(186.3157894736842, 8.296943231441055%, 55.09803921568628%); hsl(186.3157894736842, 8.296943231441055%, 36.732026143790854%);
// base1 [147, 161, 161], hsl(180, 6.930693069306934%, 60.3921568627451%); hsl(180, 6.930693069306934%, 40.26143790849673%);
// base2 [238, 232, 213], hsl(45.59999999999999, 42.37288135593221%, 88.4313725490196%); hsl(45.59999999999999, 42.37288135593221%, 58.95424836601307%);
// base3 [253, 246, 227], hsl(43.846153846153854, 86.66666666666671%, 94.11764705882352%); hsl(43.846153846153854, 86.66666666666671%, 62.745098039215684%);
// yellow [181, 137, 0], hsl(45.414364640883974, 100%, 35.490196078431374%); hsl(45.414364640883974, 100%, 23.66013071895425%);
// orange [203, 75, 22], hsl(17.569060773480665, 80.44444444444444%, 44.11764705882353%); hsl(17.569060773480665, 80.44444444444444%, 29.41176470588235%);
// red [220, 50, 47], hsl(1.0404624277456633, 71.19341563786008%, 52.352941176470594%); hsl(1.0404624277456633, 71.19341563786008%, 34.90196078431373%);
// magenta [211, 54, 130], hsl(330.95541401273886, 64.08163265306122%, 51.96078431372548%); hsl(330.95541401273886, 64.08163265306122%, 34.64052287581699%);
// violet [108, 113, 196], hsl(236.5909090909091, 42.71844660194175%, 59.6078431372549%); hsl(236.5909090909091, 42.71844660194175%, 39.73856209150327%);
// blue [ 38, 139, 210], hsl(204.7674418604651, 69.35483870967741%, 48.627450980392155%); hsl(204.7674418604651, 69.35483870967741%, 32.41830065359477%);
// cyan [ 42, 161, 152], hsl(175.46218487394958, 58.62068965517242%, 39.80392156862745%); hsl(175.46218487394958, 58.62068965517242%, 26.535947712418302%);
// green [133, 153, 0], hsl(67.84313725490196, 100%, 30%); hsl(67.84313725490196, 100%, 20%);
// colors = {
// "base03 ": [0, 43, 54],
// "base02 ": [7, 54, 66],
// "base01 ": [88, 110, 117],
// "base00 ": [101, 123, 131],
// "base0 ": [131, 148, 150],
// "base1 ": [147, 161, 161],
// "base2 ": [238, 232, 213],
// "base3 ": [253, 246, 227],
// "yellow ": [181, 137, 0],
// "orange ": [203, 75, 22],
// "red ": [220, 50, 47],
// "magenta": [211, 54, 130],
// "violet ": [108, 113, 196],
// "blue ": [38, 139, 210],
// "cyan ": [42, 161, 152],
// "green ": [133, 153, 0]
// }
// for (let i in colors) {
// // console.log(rgb[0], rgb[1], rgb[2])
// let rgb = colors[i]
// let t = cc.rgbToHsl(rgb[0], rgb[1], rgb[2])
// let name = i.trim()
// console.log(
// `$${name}: hsl(${t[0]*360}, ${t[1]*100}%, ${t[2]*100}%);\n$${name}-dark: hsl(${t[0]*360}, ${t[1]*100}%, ${t[2]*100/1.3}%);\n$${name}-light: hsl(${t[0]*360}, ${t[1]*100}%, ${(t[2]*100*1.3 > 100)?(100):(t[2]*100*1.3)}%);`
// )
// }
// let s = {
// "$foreground": "hsl(186.3157894736842, 8.296943231441055%, 55.09803921568628%);",
// "$foreground-light": "hsl(180, 6.930693069306934%, 60.3921568627451%);",
// "$background": "hsl(192.22222222222223, 100%, 10.588235294117647%);",
// "$background-light": "hsl(192.20338983050848, 80.82191780821917%, 14.31372549019608%);",
// "$cursor-text": "hsl(186.3157894736842, 8.296943231441055%, 55.09803921568628%);",
// "$cursor": "hsl(186.3157894736842, 8.296943231441055%, 55.09803921568628%);",
// "$black": "hsl(192.22222222222223, 100%, 10.588235294117647%);",
// "$black-light": "hsl(192.20338983050848, 80.82191780821917%, 14.31372549019608%);",
// "$red": "hsl(1.0404624277456633, 71.19341563786008%, 40.27149321266969%);",
// "$red-light": "hsl(1.0404624277456633, 71.19341563786008%, 52.352941176470594%);",
// "$green": "hsl(67.84313725490196, 100%, 30%);",
// "$green-light": "hsl(67.84313725490196, 100%, 39%);",
// "$yellow": "hsl(45.414364640883974, 100%, 35.490196078431374%);",
// "$yellow-light": "hsl(45.414364640883974, 100%, 46.13725490196079%);",
// "$blue": "hsl(204.7674418604651, 69.35483870967741%, 37.40573152337858%);",
// "$blue-light": "hsl(204.7674418604651, 69.35483870967741%, 48.627450980392155%);",
// "$magenta": "hsl(330.95541401273886, 64.08163265306122%, 39.96983408748114%);",
// "$magenta-light": "hsl(330.95541401273886, 64.08163265306122%, 51.96078431372548%);",
// "$cyan": "hsl(175.46218487394958, 58.62068965517242%, 30.6184012066365%);",
// "$cyan-light": "hsl(175.46218487394958, 58.62068965517242%, 39.80392156862745%);",
// "$white": "hsl(45.59999999999999, 42.37288135593221%, 88.4313725490196%);",
// "$white-light": "hsl(43.846153846153854, 86.66666666666671%, 94.11764705882352%);"
// }
// for(let k in s){
// console.log(k)
// }
// let wordIndex = 1,
// bgIndex = 2,
// wordColorName = "red",
// backgroundColorName = "black"
// --q${wordIndex}b${bgIndex}-color: red;
// --q${wordIndex}b${bgIndex}-bg-color: black;
// document.documentElement.style.setProperty(`--q${wordIndex}b${bgIndex}-color`, 'green');
// document.documentElement.style.setProperty(`--q${wordIndex}b${bgIndex}-bg-color`, 'black');
// let cssRule = `
// .q${wordIndex}.b${bgIndex}{
// color: var(--q${wordIndex}b${bgIndex}-color);
// background-color: var(--q${wordIndex}b${bgIndex}-bg-color)
// }
// `
// let specialStyle = document.createElement("style")
// specialStyle.type = "text/css"
// document.head.appendChild(specialStyle)
// console.log(cssRule)
// specialStyle.sheet.insertRule(cssRule, 0)
// document.documentElement.style.setProperty(`--q${wordIndex}b${bgIndex}-bg-color`, 'red');
// console.log("meow")
// document.documentElement.style.setProperty(`--testcolor`, 'red');
let a = 1
let s = `.q1.b2`.split('.')
let k =
console.log(s)