<commit_before>chroma = require 'chroma-js'

root = document.documentElement
uno = ''
duo = ''

module.exports =
  activate: (state) ->
    uno = atom.config.get('duotone-dark-syntax.color.uno').toHexString()
    duo = atom.config.get('duotone-dark-syntax.color.duo').toHexString()
    setColors()

    # Change Uno
    atom.config.onDidChange 'duotone-dark-syntax.color.uno', ({newValue, oldValue}) ->
      uno = newValue.toHexString()
      setColors()

    # Change Duo
    atom.config.onDidChange 'duotone-dark-syntax.color.duo', ({newValue, oldValue}) ->
      duo = newValue.toHexString()
      setColors()

  deactivate: ->
    unsetColors()

# Apply Colors -----------------------
setColors = ->
  unsetColors() # prevents adding endless properties

  # Color mixing
  _unoHigh = chroma.mix( uno, 'hsl(250, 0%, 100%)', 0.75); # mix with white
  _unoMid  = uno                                           # set by user
  _unoLow  = chroma.mix( uno, 'hsl(250, 12%, 18%)', 0.75); # mix with background (@syntax-bg)

  _duoHigh = duo                                           # set by user
  _duoLow  = chroma.mix( duo, 'hsl(250, 12%, 18%)', 0.66); # mix with background (@syntax-bg)

  # Color scales
  _scaleUno = chroma.scale([_unoHigh, _unoMid, _unoLow]).colors(5)<commit_msg>Adjust color<commit_after>chroma = require 'chroma-js'

root = document.documentElement
uno = ''
duo = ''

module.exports =
  activate: (state) ->
    uno = atom.config.get('duotone-dark-syntax.color.uno').toHexString()
    duo = atom.config.get('duotone-dark-syntax.color.duo').toHexString()
    setColors()

    # Change Uno
    atom.config.onDidChange 'duotone-dark-syntax.color.uno', ({newValue, oldValue}) ->
      uno = newValue.toHexString()
      setColors()

    # Change Duo
    atom.config.onDidChange 'duotone-dark-syntax.color.duo', ({newValue, oldValue}) ->
      duo = newValue.toHexString()
      setColors()

  deactivate: ->
    unsetColors()

# Apply Colors -----------------------
setColors = ->
  unsetColors() # prevents adding endless properties

  # Color mixing
  _unoHigh = chroma.mix( uno, 'hsl(250, 0%, 100%)', 0.5); # mix with white
  _unoMid  = uno                                           # set by user
  _unoLow  = chroma.mix( uno, 'hsl(250, 12%, 18%)', 0.75); # mix with background (@syntax-bg)

  _duoHigh = duo                                           # set by user
  _duoLow  = chroma.mix( duo, 'hsl(250, 12%, 18%)', 0.66); # mix with background (@syntax-bg)

  # Color scales
  _scaleUno = chroma.scale([_unoHigh, _unoMid, _unoLow]).colors(5)
{'fraction_non_alphanumeric': 0.16302652106084242, 'fraction_numerical': 0.02379095163806552, 'mean_word_length': 2.4568733153638815, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '66928', 'n_tokens_mistral': 921, 'n_tokens_neox': 852, 'n_words': 186}