Skip to content

Commit

Permalink
Color tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
simurai committed Sep 5, 2016
1 parent df3c4f7 commit 976f4b2
Showing 3 changed files with 18 additions and 21 deletions.
27 changes: 12 additions & 15 deletions lib/duotone.coffee
Original file line number Diff line number Diff line change
@@ -11,18 +11,15 @@ module.exports =
atom.config.observe 'duotone-light-syntax.preset', (newValue) ->
root.classList.remove('theme-duotone-light-syntax--custom-colors')
switch newValue
when "Light Winter"
uno = 'hsl(186, 91%, 42%)'
duo = 'hsl(236, 72%, 53%)'
when "Light Spring"
uno = 'hsl(93, 57%, 55%)'
duo = 'hsl(314, 100%, 43%)'
when "Light Summer"
uno = 'hsl(202, 45%, 45%)'
duo = 'hsl(33, 100%, 45%)'
when "Light Fall"
uno = 'hsl(50, 59%, 48%)'
duo = 'hsl(24, 96%, 54%)'
when "Light I"
uno = 'hsl(36, 26%, 55%)'
duo = 'hsl(241, 53%, 56%)'
when "Light II"
uno = 'hsl(210, 67%, 56%)'
duo = 'hsl(163, 49%, 36%)'
when "Light III"
uno = 'hsl(183, 100%, 34%)'
duo = 'hsl(345, 86%, 61%)'
when "Custom"
root.classList.add('theme-duotone-light-syntax--custom-colors')
uno = atom.config.get('duotone-light-syntax.unoColor').toHexString()
@@ -48,13 +45,13 @@ setColors = ->
unsetColors() # prevents adding endless properties

# Color limits
_high = chroma.mix(uno, 'hsl(0,0%,0%)', 0.5); # mix with black
_high = chroma.mix(uno, 'hsl(0,0%,0%)', 0.75); # mix with black
_mid = uno
_low = chroma.mix(uno, 'hsl(0,0%,78%)', 0.8); # mix with light grey
_low = chroma.mix(uno, 'hsl(0,0%,88%)', 0.75); # mix with light grey

# Color scales
_scaleUno = chroma.scale([ _high, _mid, _low]).colors(5)
_scaleDuo = chroma.scale([ duo, _low]).padding([0, 0.33]).colors(3)
_scaleDuo = chroma.scale([ duo, _low]).padding([0, 0.25]).colors(3)

root.style.setProperty('--uno-1', _scaleUno[0])
root.style.setProperty('--uno-2', _scaleUno[1])
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -28,22 +28,22 @@
"type": [
"string"
],
"enum": ["Light Winter", "Light Spring", "Light Summer", "Light Fall", "Custom"],
"default": "Light Winter"
"enum": ["Light I", "Light II", "Light III", "Custom"],
"default": "Light I"
},
"unoColor": {
"title": "Uno",
"description": "Customize the main color",
"order": 2,
"type": "color",
"default": "#009193"
"default": "#919191"
},
"duoColor": {
"title": "Duo",
"description": "Customize the accent color",
"order": 3,
"type": "color",
"default": "#FF9500"
"default": "#FA6365"
}
}
}
4 changes: 2 additions & 2 deletions styles/colors.less
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@

@syntax-hue: 30;

@syntax-fg: hsl(@syntax-hue, 33%, 33%);
@syntax-bg: hsl(@syntax-hue, 33%, 98%);
@syntax-fg: hsl(@syntax-hue, 8%, 33%);
@syntax-bg: hsl(@syntax-hue, 16%, 98%);
@syntax-accent: hsl(@syntax-hue, 66%, 55%);
@syntax-guide: darken(@syntax-bg, 10%);
@syntax-selection: darken(@syntax-bg, 8%);

0 comments on commit 976f4b2

Please sign in to comment.