#color-scheme #themes

wallust_themes

Embeded colorschemes in an array of u32s

1 stable release

1.0.0 Feb 2, 2024

#728 in Images

Download history 1981/week @ 2024-07-16 2250/week @ 2024-07-23 2194/week @ 2024-07-30 2180/week @ 2024-08-06 2119/week @ 2024-08-13 1877/week @ 2024-08-20 1839/week @ 2024-08-27 1594/week @ 2024-09-03 1386/week @ 2024-09-10 1361/week @ 2024-09-17 1490/week @ 2024-09-24 1492/week @ 2024-10-01 2029/week @ 2024-10-08 1830/week @ 2024-10-15 1669/week @ 2024-10-22 1519/week @ 2024-10-29

7,236 downloads per month
Used in wallust

MIT license

31KB
116 lines

wallust-themes - built in colorschemes for wallust

This is a simple crate that stores consts colorschemes in arrays (slices). Indexing in either of COLS_VALUE or COLS_KEY will result in the array values (see the spec) or the name of the colorscheme, that's why they both have the same len()ght.

NOTE: COLS_VALUE and COLS_KEY will have the same LEN as the number of files in colorschemes/.

Spec

COLS_VALUE will always store the variables in this order (starting with index 0):

  1. color0
  2. color1
  3. color2
  4. color3
  5. color4
  6. color5
  7. color6
  8. color7
  9. color8
  10. color9
  11. color10
  12. color11
  13. color12
  14. color13
  15. color14
  16. color15
  17. background
  18. foreground
  19. cursor

Making a total of 19 items. Each one of them is a u32 number that represents [u8; 3] and can be decoded by .to_le_bytes()

Example

Remember that COLS_VALUE is an array (quantity of coloschemes/) that contains arrays (19 u32s, as defined above) itself.

use wallust_themes::COLS_VALUE;
let some_color = COLS_VALUE[0][0]; //random color
// a (alpha) will always be 0, since we don't use RGBA, but RGB
let [b, g, r, a] = some_color.to_le_bytes();

New Themes

If you feel like a very well known colorscheme is missing, you should request it's addition with a json file following this format:

{
  "colors": {
    "color0": "#090300",
    "color1": "#db2d20",
    "color10": "#01a252",
    "color11": "#fded02",
    "color12": "#01a0e4",
    "color13": "#a16a94",
    "color14": "#b5e4f4",
    "color15": "#f7f7f7",
    "color2": "#01a252",
    "color3": "#fded02",
    "color4": "#01a0e4",
    "color5": "#a16a94",
    "color6": "#b5e4f4",
    "color7": "#a5a2a2",
    "color8": "#5c5855",
    "color9": "#db2d20"
  },
  "special": {
    "background": "#090300",
    "cursor": "#db2d20",
    "foreground": "#a5a2a2"
  }
}

No runtime deps

~160KB