<commit_before>module Scorched.View.Palette where

import List (repeat, indexedMap)
import Color (Color, rgb, toRgb)

background = rgb 182 182 182

shadowDark = rgb 20 20 20
shadowLight = rgb 60 60 60

highlightDark = rgb 223 223 223
highlightLight = rgb 255 255 255

cyan = rgb 40 255 255

gradient : Color -> Color -> Int -> List Color
gradient start end steps =
  let
    startComponents = toRgb start
    endComponents = toRgb end

    differences = {
      red = (endComponents.red - startComponents.red) // steps,
      green = (endComponents.green - startComponents.green) // steps,
      blue = (endComponents.blue - startComponents.blue) // steps
    }
  in
    indexedMap
      (\i _ ->
        rgb (startComponents.red + (differences.red * i))
            (startComponents.green + (differences.green * i))
            (startComponents.blue + (differences.blue * i)))
      (repeat steps Nothing)<commit_msg>cleaner list construction<commit_after>module Scorched.View.Palette where

import List (map)
import Color (Color, rgb, toRgb)

background = rgb 182 182 182

shadowDark = rgb 20 20 20
shadowLight = rgb 60 60 60

highlightDark = rgb 223 223 223
highlightLight = rgb 255 255 255

cyan = rgb 40 255 255

gradient : Color -> Color -> Int -> List Color
gradient start end steps =
  let
    startComponents = toRgb start
    endComponents = toRgb end

    differences = {
      red = (endComponents.red - startComponents.red) // steps,
      green = (endComponents.green - startComponents.green) // steps,
      blue = (endComponents.blue - startComponents.blue) // steps
    }
  in
    map
      (\i ->
        rgb (startComponents.red + (differences.red * i))
            (startComponents.green + (differences.green * i))
            (startComponents.blue + (differences.blue * i)))
      [0..(steps - 1)]
{'fraction_non_alphanumeric': 0.09900990099009901, 'fraction_numerical': 0.052805280528052806, 'mean_word_length': 2.742798353909465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1428340', 'n_tokens_mistral': 651, 'n_tokens_neox': 523, 'n_words': 175}