huge change
This commit is contained in:
parent
c159d2f3e3
commit
d86cc3c816
29 changed files with 1151 additions and 792 deletions
61
wallpapers/flake.lock
generated
Normal file
61
wallpapers/flake.lock
generated
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1761373498,
|
||||
"narHash": "sha256-Q/uhWNvd7V7k1H1ZPMy/vkx3F8C13ZcdrKjO7Jv7v0c=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6a08e6bb4e46ff7fcbb53d409b253f6bad8a28ce",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
46
wallpapers/flake.nix
Normal file
46
wallpapers/flake.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
description = "Dev env for Catppuccin Mocha LUT: ImageMagick + Python (Pillow) with a generator tool";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
|
||||
# Python environment with Pillow
|
||||
pythonEnv = pkgs.python3.withPackages (ps: [ ps.pillow ]);
|
||||
|
||||
# Small helper that writes the LUT (256x1), a preview, and a palette.txt
|
||||
|
||||
in {
|
||||
# `nix develop` (or `nix-shell` via legacy) drops you into this environment
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = [
|
||||
# ImageMagick: on most channels this provides `magick` (v7). If not, you'll have `convert`.
|
||||
pkgs.imagemagick
|
||||
pythonEnv
|
||||
];
|
||||
shellHook = ''
|
||||
echo
|
||||
echo "Catppuccin Mocha dev shell ready."
|
||||
echo "Generate assets into current dir:"
|
||||
echo " make-mocha-assets ."
|
||||
echo
|
||||
'';
|
||||
};
|
||||
|
||||
# So you can also `nix run .` to execute the generator
|
||||
|
||||
apps.default = {
|
||||
type = "app";
|
||||
};
|
||||
|
||||
formatter = pkgs.nixpkgs-fmt;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
22
wallpapers/mocha.py
Normal file
22
wallpapers/mocha.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
from PIL import Image
|
||||
import numpy as np
|
||||
|
||||
stops = [
|
||||
"#1e1e2e", "#eba0ac", "#f38ba8", "#fab387", "#f9e2af",
|
||||
"#a6e3a1", "#94e2d5", "#89dceb", "#74c7ec", "#89b4fa",
|
||||
"#b4befe", "#cdd6f4"
|
||||
]
|
||||
|
||||
def hex_to_rgb(h): return tuple(int(h[i:i+2], 16) for i in (1,3,5))
|
||||
width, height = 256, 1
|
||||
lut = Image.new("RGB", (width, height))
|
||||
pixels = lut.load()
|
||||
n = len(stops) - 1
|
||||
seg = width / n
|
||||
for x in range(width):
|
||||
i = min(int(x / seg), n-1)
|
||||
t = (x - i * seg) / seg
|
||||
c0, c1 = np.array(hex_to_rgb(stops[i])), np.array(hex_to_rgb(stops[i+1]))
|
||||
pixels[x,0] = tuple(np.round((1-t)*c0 + t*c1).astype(int))
|
||||
lut.save("catppuccin_mocha_lut.png")
|
||||
|
||||
BIN
wallpapers/tux.catppuccin-mocha.jpg
Normal file
BIN
wallpapers/tux.catppuccin-mocha.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 MiB |
BIN
wallpapers/tux.jpg
Normal file
BIN
wallpapers/tux.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 175 KiB |
Loading…
Add table
Add a link
Reference in a new issue