<commit_before>// Custom window shader for Compton.
// This is called from a shell script that replaces {Iteration} with a positive
// number. Originally based on https://github.com/chjj/compton/issues/530

uniform sampler2D tex;
void main() {
  vec4 c = texture2D(tex, gl_TexCoord[0].xy);
  float y = dot(c.rgb, vec3(0.299, 0.587, 0.114));

  int mode = {Mode} % 10;

  switch (mode) {
    default:
    // See https://andi-siess.de/rgb-to-color-temperature/
    case 0:  // Default: No transform
      gl_FragColor = vec4(c.r, c.g, c.b, 1.0);
      break;
    case 1:  // Color at 3700K
      gl_FragColor = vec4(c.r, c.g * 0.79, c.b * 0.58, 1.0);
      break;
    case 2:  // Color at 2700K
      gl_FragColor = vec4(c.r, c.g * 0.66, c.b * 0.34, 1.0);
      break;
    case 3:  // Color at 2100K
      gl_FragColor = vec4(c.r, c.g * 0.57, c.b * 0.13, 1.0);
      break;
    case 4:  // Color at 1200K
      gl_FragColor = vec4(c.r, c.g * 0.33, 0.0, 1.0);
      break;
    case 5:  // 2500K
      gl_FragColor = vec4(y, y * 0.63, y * 0.28, 1.0);
      break;
    case 6:  // 2100K Mono
      gl_FragColor = vec4(y, y * 0.57, y * 0.13, 1.0);
      break;
    case 7:  // 1700K Mono
      gl_FragColor = vec4(y, y * 0.47, 0.0, 1.0);<commit_msg>Add a 3700K grayscale mode.<commit_after>// Custom window shader for Compton.
// This is called from a shell script that replaces {Iteration} with a positive
// number. Originally based on https://github.com/chjj/compton/issues/530

uniform sampler2D tex;
void main() {
  vec4 c = texture2D(tex, gl_TexCoord[0].xy);
  float y = dot(c.rgb, vec3(0.299, 0.587, 0.114));

  int mode = {Mode} % 10;

  switch (mode) {
    default:
    // See https://andi-siess.de/rgb-to-color-temperature/
    case 0:  // Default: No transform
      gl_FragColor = vec4(c.r, c.g, c.b, 1.0);
      break;
    case 1:  // Color at 3700K
      gl_FragColor = vec4(c.r, c.g * 0.79, c.b * 0.58, 1.0);
      break;
    case 2:  // Color at 2700K
      gl_FragColor = vec4(c.r, c.g * 0.66, c.b * 0.34, 1.0);
      break;
    case 3:  // Color at 2100K
      gl_FragColor = vec4(c.r, c.g * 0.57, c.b * 0.13, 1.0);
      break;
    case 4:  // Color at 1200K
      gl_FragColor = vec4(c.r, c.g * 0.33, 0.0, 1.0);
      break;
    case 5:  // 3700K Mono
      gl_FragColor = vec4(y, y * 0.79, y * 0.58, 1.0);
      break;
    case 6:  // 2100K Mono
      gl_FragColor = vec4(y, y * 0.57, y * 0.13, 1.0);
      break;
    case 7:  // 1700K Mono
      gl_FragColor = vec4(y, y * 0.47, 0.0, 1.0);
{'fraction_non_alphanumeric': 0.1624750499001996, 'fraction_numerical': 0.09900199600798404, 'mean_word_length': 2.02291917973462, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '3982654', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1058, 'n_words': 290}