File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1
1
'use babel'
2
2
3
+ /**
4
+ *
5
+ * @param {{ [P: string]: string } } selectors
6
+ */
3
7
export function getColors ( selectors : { [ P : string ] : string } ) {
4
8
// const grammar = atom.grammars.grammarForScopeName("source.julia") // TODO ?
5
9
6
10
const div = document . createElement ( 'div' )
7
11
div . classList . add ( 'editor' , 'editor-colors' , 'julia-syntax-color-selector' )
12
+
13
+ /**
14
+ * @type { [P: string]: HTMLSpanElement }
15
+ */
8
16
const styled : { [ P : string ] : HTMLSpanElement } = { }
17
+ /**
18
+ * { [P: string]: string }
19
+ */
9
20
const color : { [ P : string ] : string } = { }
10
21
11
22
for ( const style in selectors ) {
@@ -32,6 +43,11 @@ export function getColors(selectors: { [P: string]: string }) {
32
43
return color
33
44
}
34
45
46
+ /**
47
+ *
48
+ * @param {string } rgb
49
+ * @return {string }
50
+ */
35
51
function rgb2hex ( rgb : string ) : string {
36
52
if ( rgb . search ( "rgb" ) === - 1 ) {
37
53
return rgb
@@ -48,6 +64,10 @@ function rgb2hex(rgb: string): string {
48
64
}
49
65
}
50
66
67
+ /**
68
+ *
69
+ * @param {string } x
70
+ */
51
71
function hex ( x : string ) {
52
72
return ( "0" + parseInt ( x , 10 ) . toString ( 16 ) ) . slice ( - 2 )
53
73
}
You can’t perform that action at this time.
0 commit comments