rvdz / hapycolor

Generates beautiful color palettes from images
MIT License
3 stars 0 forks source link

Added i3 support #17

Closed nyancol closed 6 years ago

nyancol commented 6 years ago

NOTE: It might be better starting to review Configuration Editor pull request before, since this branch uses some of its features.

Features supported:

Utilities: ConfigurationEditor

Located in 'hapycolor.configuration_editor.ConfigurationEditor'. Takes a list of strings and searches for lines similar to # @hapycolor("random"), then, given a palette of color, the color in the line following the macro will be replaced, for more info, please check the docstring of the class. There might be a better name than ConfigurationEditor, I'm open to suggestions.

romzie commented 6 years ago

I think all colors should be chosen by the user using the token method, same as yabar. Or we may add a color option to do what you suggest. Just saying the user needs to have the choice. I don't think we need to replace i3bar line. Why would we care about anything else than colors in the user config? I know its the name of the branch but still, I don't see the purpose.

nyancol commented 6 years ago

I agree. My first thought was to have something that initializes the configuration, but since the user already installed yabar, he should already know what to do about it. But then, we should make sure to document where the generated configuration file will be and its name.

nyancol commented 6 years ago

But I still consider that hapycolor should automatically update the wallpaper iff the wallpaper target is enabled. Do you agree?

nyancol commented 6 years ago

It just came to my mind that instead of having a configuration file where we define the colors, and another generated by hapycolor, we could use only one file, and define the colors to replace with some kind of macro, for instance:

? @hapycolor.autofill.foreground
color_1 #010203
? @hapycolor.autofill.random
color_2 #123456

where ? is the character that defines the beginning of a comment. Hapycolor should be able to identify the colors defined in the following line, and replace them with the ones contained in the palette. The issue would be if there are three colors on the same line and the user only wants to change the first and the last one. But still, a command such as ? @hapycolor.autofill.random([0,2]) could do the job. Any thoughts?

nyancol commented 6 years ago

Or maybe, for multiple colors on one line the following syntax is more appropriate: ? @hapycolor.autofill("random", None, "foreground")

This means that the first color will be replaced by a "random" color, the second one will be left as it was and the third will be replaced by the "foreground"