home | blog | art | now | git gpg | email | rss

morph

Generate xresources colors from an image.
git clone https://pollux.codes/git/morph.git
Log | Files | Refs | README | LICENSE
commit 0672eddc1d4c16fff3d63e7f6e30b8a71029c2f8
parent 34a97e4aed492fc0ee424bbcfd6011c344b9b1a1
Author: Pollux <pollux@pollux.codes>
Date:   Sat, 19 Jul 2025 16:23:56 -0500

docs: Next development steps

Signed-off-by: Pollux <pollux@pollux.codes>

Diffstat:
Mmorph.c | 13++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/morph.c b/morph.c @@ -228,7 +228,7 @@ cluster_image_colors(col_lab_t *colors, int color_count, int cluster_count) { } // Sort largest collection by largest dimension and split into two clusters - // TODO: Replace with quickselect followed by partition + // TODO OPTIMIZE: Replace with quickselect followed by partition switch (largest_dimension) { case 0: @@ -258,7 +258,7 @@ cluster_image_colors(col_lab_t *colors, int color_count, int cluster_count) { } // Find the median color of each cluster - // TODO: Optimize this using quickselect + // TODO OPTIMIZE: Optimize this using quickselect for(int c = 0; c < cluster_count; c++) { @@ -302,12 +302,11 @@ main(int argc, char **argv) { col_lab_t *primary_colors = cluster_image_colors(image_pixels_lab, pixel_count, 128); - for(int c = 0; c < 128; c++) { - col_rgb_t rgb = lab_to_rgb(primary_colors[c]); + // TODO: Combine primary colors with copies rotated in hue. - printf("#%02x%02x%02x\n", (int)(rgb.r * 255), - (int)(rgb.g * 255), (int)(rgb.b * 255)); - } + // TODO: Match colors with target colors + + // TODO: Export colors free(image_pixels); free(image_pixels_lab);