iniox / matugen Goto Github PK
View Code? Open in Web Editor NEWA material you color generation tool
License: GNU General Public License v2.0
A material you color generation tool
License: GNU General Public License v2.0
I really love the harmonized color feature in concept, but it does not seem to work well with dynamic theming (using dark and light theme and different source colors with the same config file).
For context, what I'd ideally want is a solution to get very rough hues for a few colors (usually the terminal colors) and have them adjusted to look nice with the theme color while also maintaining good contrast with the surface
color like accent colors do.
The harmonization seems to preserve the source colors a little too well, and ends up with variants that may work well in dark theme or light theme, but almost never in both.
(If you want to know why I want custom colors in the first place, I really like my syntax highlighting to be generally the same hues. Strings green, numbers blue, etc)
Input #00ff00
Input #ff0000
There's almost zero adjustment between dark and light, and looks to me like they only get shifted along the hue axis. This unfortunately means that they are more or less unusable for the purpose of readable content (as opposed to art against a background).
Ideally I'd like a solution where I could add static colors as per md3 spec, and get a full set of these.
Why
You may need to apply static colors in your app for brand expression or to communicate semantic meaning, like a green success state. By defining these colors using the Material system, they'll work with existing Material colors and support features like dynamic color and user-controlled contrast.
How
Use the Material Theme Builder to input a custom color. Material will return four color roles derived from that reference color. The main color, on-main color, container color, and on-container color all follow the conventions of the accent colors in the main scheme, and can be applied to your UI according to the same relationships. See map or remap colors on UI elements for more information.
[config.static_colors]
red = "#ff0000"
some_prop = {{colors.red.default.hex}}
some_prop = {{colors.on_red.default.hex}}
some_prop = {{colors.red_container.default.hex}}
some_prop = {{colors.red_90.default.hex}} #maybe? bonus addition
I have a script which passes --mode light
or dark depending on time of day, but i like my Waybar being always dark, so for the Waybar template i set mode = "Dark"
in the Matugen config, but this seems to make no difference
Would it be possible to output the 8 basic terminal colors (black, red, green, yellow, blue, magenta, cyan and white) based on the wallpaper alongside the normal output?
I was wondering if it would be feasible to implement a base16 theme input to Matugen? I understand that I could create an image palette with the given theme's colors, but being able to input a .json file and get the material colors version of the them would be very nice.
I cant seem to get the custom keywords to work, as far as I can see this is how you are meant to do it per the wiki but maybe I am misunderstanding?
Matugen Config (it is written by nix so those ${} values are replaced):
[config.custom_keywords.rounding]
find = 'rounding'
replace = '${rounding}'
[config.custom_keywords.transparency]
find = 'transparency'
replace = '${transparency}'
Error Message:
Error:
0: TOML parse error at line 8, column 1
0: |
0: 8 | [config.custom_keywords.rounding]
0: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0: invalid type: map, expected a string
0:
Any help would be greatly appreciated
On the last update, harmonized_colors
was reworked into custom_colors
. So the new way to define harmonized_colors
in templates is:
# config
[config.custom_colors]
red = "#fb4934"
{{colors.red.default.hex}}
Where the previous way to define it was:
# config
[config.colors_to_harmonize]
red = "#fb4934"
{{harmonized_colors.red.hex}}
However, the template example gave in example/colors.whatever-extension
, stills show the previous way to define templates. It should be updated to the new one
Edit: The config in example/config.toml
is updated, the change is only required in example/colors.whatever-extension
,
Hello. I am on a macOS, and I attempted to update my version of matugen by reinstalling it via cargo. However, I encountered the following error message while doing so:
error[E0433]: failed to resolve: use of undeclared crate or module `enquote`
--> /Users/kl/.cargo/registry/src/index.crates.io-6f17d22bba15001f/matugen-1.2.1/src/wallpaper/macos.rs:9:9
|
9 | enquote::enquote('"', path),
| ^^^^^^^ use of undeclared crate or module `enquote`
For more information about this error, try `rustc --explain E0433`.
error: could not compile `matugen` (bin "matugen") due to previous error
error: failed to compile `matugen v1.2.1`, intermediate artifacts can be found at `/var/folders/gv/ff_6l8ys0mzb8bbrg2s7s5f00000gn/T/cargo-install6q2jJi`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
Thank you!
I'm almost reaching the perfect rice, but I didn't find an easy way to select the available colors of papirus-folders based on accent_color in matugen
I tried several times and it doesn't do anything
Hi!
it would be really cool there were an extra dark mode ala AMOLED black. Not sure where to start with that though.
Hi there, was trying out this tool and I think the example config is broken as I try to run it and I get the following error:
matugen image ~/Projects/dotfiles/ags/assets/space.jpg
Error:
0: render error
--> name1:28:36
|
28 | @define-color source_color {{colors.source_color.default.hex}};;
| ^^^^^^^^^^^^^
|
= reason: not found in map
0:
1: render error: not found in map
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
I'd like to generate a palette with some predefined colors. For example, have the primary and secondary colors locked-in, and generate the rest of the palette around those. Is this possible?
The version check seems to take a rather substantial amount of the execution time, as well as being useless if the app is installed via the system package manager.
Imo the check should be opt-in, as it makes a network request that is not required for the app to function.
My config: File
[templates.kitty]
input_path = '/.config/matugen/default/kitty.conf'/.config/kitty/colors.conf'
output_path = '
[config]
reload_apps = true
set_wallpaper = false
[config.reload_apps_list]
kitty = true
gtk_theme = true
When generating new color scheme, the prefixes is not replaced, my final file:
cursor #f0f0f0
cursor_text_color #ffffff
@{surface}
i need use
{{colors.on_surface.default.hex}}
Hi!
The colors exported to the css file via template seems to have the green and blue channels swapped.
The error seems to be here in template.rs
regexvec.push(ColorPatterns {
hex: ColorPattern {
pattern: Regex::new(&format!(r#"{prefix}{{{field}}}"#).to_string())?,
replacement: format_argb_as_rgb([color.alpha, color.red, color.blue, color.green]),
},
hex_stripped: ColorPattern {
pattern: Regex::new(&format!(r#"{prefix}{{{field}.strip}}"#).to_string())?,
replacement: format_argb_as_rgb([color.alpha, color.red, color.blue, color.green])
[1..]
.to_string(),
},
rgb: ColorPattern {
pattern: Regex::new(&format!(r#"{prefix}{{{field}.rgb}}"#).to_string())?,
replacement: format!("rgb({:?}, {:?}, {:?})", color.red, color.blue, color.green),
},
rgba: ColorPattern {
pattern: Regex::new(&format!(r#"{prefix}{{{field}.rgba}}"#).to_string())?,
replacement: format!(
"rgba({:?}, {:?}, {:?}, {:?})",
color.red, color.green, color.blue, color.alpha
),
},
});
where instead of color.red, coilor.green, color.blue ; we have color.red, color.blue, color.green
I want to imperatively select my wallpaper (with rofi). I figured that the nixOS module would act like most home-manager modules and simply let me configure the matugen.toml
file instead of launching the command once with the supplied args.
Is there any chance we'll get a module that can write the configuration file instead? Nix modules for toml files are relatively easy to write. For reference take a look at the starship hm-module.
The code in template.rs
file is pretty messy, it needs a rewrite.
Matugen should replace the regex library with a template engine, so it's easier to add more color formats (like red, green, blue, saruration, hue, and lightness as separate formats), while also making the code more readable and easier to maintain.
Replacing the engine would also make it so you can add custom user defined keywords.
Any chance of creating an AUR package? Thank you.
for example i create an wofi styles.css
the primary color from a wallpaper is shown by matugen as
#b7c8e1 but the color in the generated css is
#b7e1c8
so color.green and color.blue is switched
also if i use primary.rgb
btw .hex is not working in templates.
template.rs line 155, 159 & 165
replacement: format!("rgb({:?}, {:?}, {:?})", color.red, color.blue, color.green)
red green blue ;)
I was testing some custom colors to use in templates and this bug appeared when trying to run matugen:
Bug:
Opening image in /var/home/heus/Pictures/Wallpapers/beautiful-wallpapers/2023-08-14-11-00-18-bici.jpg
The application panicked (crashed).
Message: Failed to parse custom color: ParseRGB
Location: src/main.rs:92
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Config.toml
[config.custom_colors]
success = { color = "#1b8553", blend = false }
urgent = { color = "#ff0000", blend = false }
white = { color = "#ffffff", blend = false }
transparent_black = { color = "rgba(0, 0, 0, 0.07)", blend = false }
semi_transparent_black = { color = "rgba(0, 0, 0, 0.8)", blend = false }
light_pastel_blue = { color = "#d7e3f0", blend = false }
Template for gtk
@define-color headerbar_border_color {{colors.semi_transparent_black.default.rgba}};
@define-color headerbar_shade_color {{colors.transparent_black.default.rgba}};
@define-color card_shade_color {{colors.transparent_black.default.rgba}};
@define-color thumbnail_fg_color {{colors.semi_transparent_black.default.rgba}};
@define-color shade_color {{colors.transparent_black.default.rgba}};
@define-color incognito_bg_color {{colors.light_pastel_blue.default.hex}};
Hi,
I've tried to figure out, how to use matugen home-manager module, but to no avail. I've created config file, with contents described below, and imported in my home.nix and it just don't work. Maybe I'm misunderstanding how to use it?
{inputs, ...}: {
imports = [
inputs.matugen.nixosModules.default
];
programs.matugen = {
enable = true;
variant = "dark";
jsonFormat = "hex";
palette = "default";
templates = {
ags = {
input_path = "./templates/ags.scss";
output_path = "~/.config/ags/scss/colors.scss";
};
kittty = {
input_path = "./templates/kitty.conf";
output_path = "~/.config/kitty/colors.conf";
};
gtk = {
input_path = "./templates/gtk.css";
output_path = "~/.config/gtk-4.0/gtk.css";
};
hypr = {
input_path = "./templates/hypr.conf";
output_path = "~/.config/hypr/colors.conf";
};
yazi = {
input_path = "./templates/yazi.toml";
output_path = "~/.config/yazi/theme.toml";
};
};
};
}
I would like to know if it was possible to implement something to blend a certain color towards the colorscheme generated. For example it would allow to produce a base16 theme for the terminal who is more related to the scheme instead of changing only background foreround and accent. So it would be like implementing the blend component to matugen. COuld be used like a filter idk...
These apps don't auto reload, and need these commands to read new colors
App: command
bat: bat cache --build
swaync: swayns-client -rs
I was thinking about this type of case, do you find the idea interesting?
swww example
[config]
reload_apps = true
set_wallpaper = true
wallpaper_tool = 'swww'
swww_options = [
"--transition-type",
"center",
"--transition-fps",
"60",
"--transition-duration",
"3"
"--transition-bezier",
"0.4,0.2,0.4,1.0"
]
run_after = [
[ "{wallpaper_tool} {image} {swww_options}" ],
]
Thinking about it, the example is bad since matugen already does this, but adding a section for custom variables could be interesting
example:
[Custom-Variables]
custom_wallpaper_tool = "wpaperd"
custom_wallpaper_options [ ... ]
that way matugen wouldn't have to support new wallpaper tools
then these variables could be used in hooks
and run_after
[config]
run_after = [ " {custom_wallpaper_tool} {image} {custom_wallpaper_options} " ]
I generally use the dark theme, but I wanted to see what the themes would look like in light mode, but there is no way to generate two files, one for dark mode and one for light mode, just overwrite
Hi!
As requested, I'm making a new issue/feature request for adding other non monotone color schemes in different schema such as
my preference would be Triadic or Adjacent since they already fit into the three-color format used by the monet engine.
Best,
KSH
The material-color-utilities-rs crate has last been updated 10 months ago and is missing some features. It would be better to switch to material-colors that has been released 3 weeks ago.
Updating the NetBSD package to the latest 0.10.0
Rust-1.71.1
FI,
Compiling ini-material-color-utilities-rs v0.4.0 (/usr/pkgsrc/wip/matugen/work/matugen-matugen-v0.10.0/material-color-utilities-rs)
warning: unused import: `linearized`
--> material-color-utilities-rs/src/htc/cam16.rs:4:41
|
4 | use crate::util::color::{argb_from_xyz, linearized, xyz_from_argb};
| ^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
Compiling resolve-path v0.1.0
warning: associated function `new` is never used
--> material-color-utilities-rs/src/htc/cam16.rs:119:8
|
34 | impl Cam16 {
| ---------- associated function in this implementation
...
119 | fn new(
| ^^^
|
= note: `#[warn(dead_code)]` on by default
Compiling directories v5.0.1
Compiling toml v0.7.3
Compiling pretty_env_logger v0.4.0
Compiling colorsys v0.6.7
warning: `ini-material-color-utilities-rs` (lib) generated 2 warnings (run `cargo fix --lib -p ini-material-color-utilities-rs` to apply 1 suggestion)
just for reference, this is the image im using, the colors i'm getting from matugen don't match at all with the image
(ignore i'm also using custom colors to generate terminal colors)
i tried different color scheme types with varying results (best i could get was with scheme-fruit-salad but its too bright green for me)
the image basically has no blue in it despite being the primary color, pywal can do this correctly but matugen seems to prioritize error color over the primary colors of the image
json colors shown:
{
"colors": {
"dark": {
"background": "#121414",
"color1": "#dcbfc5",
"color10": "#c3c9b3",
"color10_container": "#434938",
"color10_source": "#b9b99b",
"color10_value": "#b9b99b",
"color11": "#cec7ac",
"color11_container": "#4b4732",
"color11_source": "#c8b692",
"color11_value": "#c8b692",
"color12": "#c6c5d6",
"color12_container": "#454654",
"color12_source": "#a299b9",
"color12_value": "#a299b9",
"color13": "#d0c2d3",
"color13_container": "#4d4351",
"color13_source": "#b997b4",
"color13_value": "#b997b4",
"color14": "#bbc8d2",
"color14_container": "#3c4851",
"color14_source": "#9bb0ca",
"color14_value": "#9bb0ca",
"color1_container": "#564146",
"color1_source": "#d49191",
"color1_value": "#d49191",
"color2": "#c3c9b2",
"color2_container": "#434938",
"color2_source": "#b6b696",
"color2_value": "#b6b696",
"color3": "#cec7ab",
"color3_container": "#4b4732",
"color3_source": "#c4b392",
"color3_value": "#c4b392",
"color4": "#c6c5d6",
"color4_container": "#454654",
"color4_source": "#9e96b6",
"color4_value": "#9e96b6",
"color5": "#d0c2d3",
"color5_container": "#4d4351",
"color5_source": "#b696b1",
"color5_value": "#b696b1",
"color6": "#bcc8d3",
"color6_container": "#3d4851",
"color6_source": "#98acc8",
"color6_value": "#98acc8",
"color9": "#ddbfc5",
"color9_container": "#564146",
"color9_source": "#d89393",
"color9_value": "#d89393",
"error": "#ffb4ab",
"error_container": "#93000a",
"inverse_on_surface": "#2f3031",
"inverse_primary": "#516164",
"inverse_surface": "#e3e2e2",
"on_background": "#e3e2e2",
"on_color1": "#3e2b30",
"on_color10": "#2d3223",
"on_color10_container": "#dfe5ce",
"on_color11": "#34311e",
"on_color11_container": "#eae3c6",
"on_color12": "#2f2f3d",
"on_color12_container": "#e2e1f3",
"on_color13": "#362d3a",
"on_color13_container": "#eddeef",
"on_color14": "#26323a",
"on_color14_container": "#d7e4ef",
"on_color1_container": "#fadbe1",
"on_color2": "#2d3222",
"on_color2_container": "#dfe5cd",
"on_color3": "#34311d",
"on_color3_container": "#eae2c6",
"on_color4": "#2e2f3d",
"on_color4_container": "#e2e1f3",
"on_color5": "#362d3a",
"on_color5_container": "#eddeef",
"on_color6": "#26323a",
"on_color6_container": "#d8e4ef",
"on_color9": "#3e2b30",
"on_color9_container": "#fadbe1",
"on_error": "#690005",
"on_error_container": "#ffdad6",
"on_primary": "#233336",
"on_primary_container": "#d4e6e9",
"on_primary_fixed": "#0e1e21",
"on_primary_fixed_variant": "#39494c",
"on_secondary": "#293234",
"on_secondary_container": "#dbe4e6",
"on_secondary_fixed": "#141d1f",
"on_secondary_fixed_variant": "#3f484a",
"on_surface": "#e3e2e2",
"on_surface_variant": "#c7c6c6",
"on_tertiary": "#1c3438",
"on_tertiary_container": "#cde7ec",
"on_tertiary_fixed": "#051f23",
"on_tertiary_fixed_variant": "#334b4f",
"outline": "#919191",
"outline_variant": "#464747",
"primary": "#b8cacd",
"primary_container": "#39494c",
"primary_fixed": "#d4e6e9",
"primary_fixed_dim": "#b8cacd",
"scrim": "#000000",
"secondary": "#bfc8ca",
"secondary_container": "#3f484a",
"secondary_fixed": "#dbe4e6",
"secondary_fixed_dim": "#bfc8ca",
"shadow": "#000000",
"surface": "#121414",
"surface_bright": "#383939",
"surface_container": "#1f2020",
"surface_container_high": "#292a2a",
"surface_container_highest": "#343535",
"surface_container_low": "#1b1c1c",
"surface_container_lowest": "#0d0e0f",
"surface_dim": "#121414",
"surface_variant": "#464747",
"tertiary": "#b1cbd0",
"tertiary_container": "#334b4f",
"tertiary_fixed": "#cde7ec",
"tertiary_fixed_dim": "#b1cbd0"
},
"light": {
"background": "#faf9f9",
"color1": "#6f585e",
"color10": "#5a614e",
"color10_container": "#dfe5ce",
"color10_source": "#b9b99b",
"color10_value": "#b9b99b",
"color11": "#635f48",
"color11_container": "#eae3c6",
"color11_source": "#c8b692",
"color11_value": "#c8b692",
"color12": "#5d5d6c",
"color12_container": "#e2e1f3",
"color12_source": "#a299b9",
"color12_value": "#a299b9",
"color13": "#665b69",
"color13_container": "#eddeef",
"color13_source": "#b997b4",
"color13_value": "#b997b4",
"color14": "#546069",
"color14_container": "#d7e4ef",
"color14_source": "#9bb0ca",
"color14_value": "#9bb0ca",
"color1_container": "#fadbe1",
"color1_source": "#d49191",
"color1_value": "#d49191",
"color2": "#5b614e",
"color2_container": "#dfe5cd",
"color2_source": "#b6b696",
"color2_value": "#b6b696",
"color3": "#645f48",
"color3_container": "#eae2c6",
"color3_source": "#c4b392",
"color3_value": "#c4b392",
"color4": "#5d5d6c",
"color4_container": "#e2e1f3",
"color4_source": "#9e96b6",
"color4_value": "#9e96b6",
"color5": "#655b69",
"color5_container": "#eddeef",
"color5_source": "#b696b1",
"color5_value": "#b696b1",
"color6": "#546069",
"color6_container": "#d8e4ef",
"color6_source": "#98acc8",
"color6_value": "#98acc8",
"color9": "#6f585d",
"color9_container": "#fadbe1",
"color9_source": "#d89393",
"color9_value": "#d89393",
"error": "#ba1a1a",
"error_container": "#ffdad6",
"inverse_on_surface": "#f2f0f0",
"inverse_primary": "#b8cacd",
"inverse_surface": "#2f3031",
"on_background": "#1b1c1c",
"on_color1": "#ffffff",
"on_color10": "#ffffff",
"on_color10_container": "#181d0f",
"on_color11": "#ffffff",
"on_color11_container": "#1f1c0a",
"on_color12": "#ffffff",
"on_color12_container": "#1a1b27",
"on_color13": "#ffffff",
"on_color13_container": "#211925",
"on_color14": "#ffffff",
"on_color14_container": "#111d25",
"on_color1_container": "#27171b",
"on_color2": "#ffffff",
"on_color2_container": "#181d0f",
"on_color3": "#ffffff",
"on_color3_container": "#1f1c0a",
"on_color4": "#ffffff",
"on_color4_container": "#191b27",
"on_color5": "#ffffff",
"on_color5_container": "#211925",
"on_color6": "#ffffff",
"on_color6_container": "#111d25",
"on_color9": "#ffffff",
"on_color9_container": "#28171b",
"on_error": "#ffffff",
"on_error_container": "#410002",
"on_primary": "#ffffff",
"on_primary_container": "#0e1e21",
"on_primary_fixed": "#0e1e21",
"on_primary_fixed_variant": "#39494c",
"on_secondary": "#ffffff",
"on_secondary_container": "#141d1f",
"on_secondary_fixed": "#141d1f",
"on_secondary_fixed_variant": "#3f484a",
"on_surface": "#1b1c1c",
"on_surface_variant": "#464747",
"on_tertiary": "#ffffff",
"on_tertiary_container": "#051f23",
"on_tertiary_fixed": "#051f23",
"on_tertiary_fixed_variant": "#334b4f",
"outline": "#777777",
"outline_variant": "#c7c6c6",
"primary": "#516164",
"primary_container": "#d4e6e9",
"primary_fixed": "#d4e6e9",
"primary_fixed_dim": "#b8cacd",
"scrim": "#000000",
"secondary": "#576062",
"secondary_container": "#dbe4e6",
"secondary_fixed": "#dbe4e6",
"secondary_fixed_dim": "#bfc8ca",
"shadow": "#000000",
"source_color": "#4a5a5d",
"surface": "#faf9f9",
"surface_bright": "#faf9f9",
"surface_container": "#efeded",
"surface_container_high": "#e9e8e8",
"surface_container_highest": "#e3e2e2",
"surface_container_low": "#f5f3f3",
"surface_container_lowest": "#ffffff",
"surface_dim": "#dbdada",
"surface_variant": "#e3e2e2",
"tertiary": "#4a6267",
"tertiary_container": "#cde7ec",
"tertiary_fixed": "#cde7ec",
"tertiary_fixed_dim": "#b1cbd0"
}
}
}
colored image preview (partial):
is there any workarounds i can try right now?
I am trying to install matugen using flake.nix. I followed the instructions in the readme and got the following error:
error: builder for '/nix/store/i5g10yffkx7afalsg0dwkblr4xbnqrld-matugen-2.2.0.drv' failed with exit code 101;
last 20 log lines:
> |
> 1 | pub use core::CorePalette;
> | ^^^^ ambiguous name
> |
> = note: ambiguous because of multiple potential import sources
> = note: `core` could refer to a built-in crate
> = help: use `::core` to refer to this crate unambiguously
> note: `core` could also refer to the module defined here
> --> /build/cargo-vendor-dir/material-colors-0.3.1/src/palette/mod.rs:4:1
> |
> 4 | mod core;
> | ^^^^^^^^^
> = help: use `self::core` to refer to this module unambiguously
>
> Compiling paris-log v1.0.2
> Compiling clap v4.4.11
> Compiling resolve-path v0.1.0
> For more information about this error, try `rustc --explain E0659`.
> error: could not compile `material-colors` (lib) due to previous error
hi...
first. this is a great project and i'm happy that i found it.
i managed to theme my hyprland, waybar, cava, kitty, astrovim, wofi and mako (notification daemon)
gut what i did not understand was the gtk theme.
tryed to figure it out also with your dotfiles (nixos tree).
it would be great if you could send an short tutorial something simular.
(also checked mitsugen)
Thanks,
I would like to contribute and share some templates I made, and this would avoid fragmentation and code duplication from everyone making a different template
As the title says
I couldn't figure where the issue was to get swww_options to be applied
here is the config file
[config]
set_wallpaper = true
wallpaper_tool = 'Swww'
swww_options = ['--transition-type', 'wipe']
[templates.material_colors] # Main file
input_path = '~/.config/matugen/templates/_material_template.scss'
output_path = '~/.cache/ags/user/generated/material_colors.scss'
[templates.primary_color] # Color source
input_path = '~/.config/matugen/templates/_color.txt'
output_path = '~/.cache/ags/user/color.txt'
[templates.hyprlock] # Hyprlock
input_path = '~/.config/matugen/templates/hypr/hyprlock.conf'
output_path = '~/.cache/ags/user/generated/hypr/hyprlock.conf'
[templates.hyprland_color] # Hyprland
input_path = '~/.config/matugen/templates/hypr/hyprland/colors.conf'
output_path = '~/.cache/ags/user/generated/hypr/hyprland/colors.conf'
Hi, I got this error when running
matugen image imagepath --json hex
here's the output
The application panicked (crashed).
Message: attempt to divide by zero
Location: /home/ezerinz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/material-colors-0.2.1/src/quantize/quantizer_wu.rs:274
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
the output with RUST_BACKTRACE=fuill :
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⋮ 6 frames hidden ⋮
7: core::panicking::panic::h3a6ee9ab3bd88b9b
at <unknown source file>:<unknown line>
8: material_colors::quantize::quantizer_wu::QuantizerWu::variance::hc92ce0aabe322924
at <unknown source file>:<unknown line>
9: material_colors::quantize::quantizer_wu::QuantizerWu::create_boxes::hdd1f6b13f7e872ca
at <unknown source file>:<unknown line>
10: <material_colors::quantize::quantizer_wu::QuantizerWu as material_colors::quantize::quantizer::Quantizer>::quantize::h8f0c5af9e90244aa
at <unknown source file>:<unknown line>
11: <material_colors::quantize::quantizer_celebi::QuantizerCelebi as material_colors::quantize::quantizer::Quantizer>::quantize::h4d0b10b9de5a1f2d
at <unknown source file>:<unknown line>
12: material_colors::utils::image::ImageReader::extract_color::h3482ae9b646f0042
at <unknown source file>:<unknown line>
13: matugen::util::color::get_source_color::h7b2d4074c4118660
at <unknown source file>:<unknown line>
14: matugen::main::h2a7c26fee03efcd9
at <unknown source file>:<unknown line>
15: std::sys_common::backtrace::__rust_begin_short_backtrace::ha51465a398fe07a2
at <unknown source file>:<unknown line>
16: std::rt::lang_start::{{closure}}::h122fa072e691f758
at <unknown source file>:<unknown line>
17: std::rt::lang_start_internal::h24e0e4b30b186ec6
at <unknown source file>:<unknown line>
18: main<unknown>
at <unknown source file>:<unknown line>
19: __libc_start_main<unknown>
at <unknown source file>:<unknown line>
20: _start<unknown>
at <unknown source file>:<unknown line>
Thank you very much for this project! I should clarify, this very much could be a non-issue or a material-color-utilities-rs problem and not a Matugen one; please let me know if so.
I was trying to use Matugen to create a GTK3/4 theme based on my wallpaper (the exact same thing that Gradience can do but I wanted to use Matugen to be able to theme many different things). After setting the wallpaper and rebuilding, I noticed the colors didn't match up at all. My apps were a bright blue color, while the wallpaper contains only a small amount of very muted blue/teal:
After a while of debugging, I believe I've narrowed the issue down to either Matugen or material-color-utilities-rs. Here is what the official Material Theme Builder produces (very understandably):
Lastly, heres a comparison of the JSON output of Matugen (matugen image Downloads/alena-aenami-budapest.jpg --json hex | jq
) vs material_color_utilities_python (using the exact same python script that Gradience uses) vs the theme builder, all on dark mode:
IMO, Matugen's output does not follow the image. However, it's interesting that some of the colors seem to match the other two outputs almost exactly (eg. "error").
I should also mention that I tried this with two other wallpapers as well; Matugen did better slightly better following the other two, but seemed to sway extra towards blue comparatively (this could probably use more testing).
Please let me know if you have any ideas what might be causing this, and if you think I should instead report it to material-color-utilities-rs!
Hi! I saw that this project supports macOS, and I wanted to try it out. I know that reloading applications and setting the wallpaper is only supported on Linux platforms, but I wanted to see the colors it could generate from images. When attempting to install this on macOS via cargo, I get the following error:
error[E0432]: unresolved imports util::reload::reload_apps_linux, util::wallpaper::set_wallaper
Is there a way to skip these utils since they won't work on macOS at all? If not, are there alternate ways to install matugen on a macOS? Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.