GiorgosXou / TUIFIManager

A cross-platform terminal-based termux-oriented file manager (and component), meant to be used with a Uni-Curses project or as is.
GNU General Public License v3.0
688 stars 13 forks source link

How do I change the default colors? #38

Open yochananmarqos opened 1 year ago

yochananmarqos commented 1 year ago

You said:

A bit complicated to explain here just make an issue and I will explain it there

So I did.

GiorgosXou commented 1 year ago

When used as a Component inside a project and not as a utility\command, you can pretty much change the colors as you like:

tuifi_Peek 2023-01-01 19-22

As for the utility\command customizations there's going to be an update (there's also a discussion about it here)

But there's also an issue I found today that might get a while to be fixed, (most probably) related to the ncurses not performing the A_DIM effect on other than the first 7 colors for some unknown reason. And even wierder, when initializing a color (with init_color) to one of those first 7 ones (like:init_color(2,0,1000,843)) the dim effect gets the dimmed color of the previously\first defined color. image

GiorgosXou commented 1 year ago

A_DIM effect is being used by the hidden files (in case of anyone coming from this post)

GiorgosXou commented 4 months ago

https://github.com/unicurses/unicurses/issues/41

GiorgosXou commented 4 months ago

So, from my understanding both ncurses and pdcurses support 10bit colors (0-1000 per channel) with init_color (as long as the terminal supports them ofcourse [has_colors can_change_color]).

But even though ncurses says it also supports the extended 15 bit colors (unsigned int 0-32767 per channel) via init_extended_color, I fail to get consistent coloring via this function on alacritty with latest ncurses-version... unless again, I use values between 0-1000, only then I have normal color distribution.

Anyways 10bit are fine for now. ✨ Also another thing i've noticed, which caught my eye! is when i initialize more than 255 colors (using either init_color or init_extended_colors) colors start to get funky (meaning no color distribution consistancy)

update haven't tested it but is it the initialization of colors or pairs, that is limmited to 255?

GiorgosXou commented 4 months ago

ignore this joke bellow, I just found it cute and felt to share it. I haven't figured out yet how to handle the whole situation of coloring correctly\correctly (from the prespective of: how to make it easy for the user to initialize colors via a config and etc.). I guess, as a first step I'll just allow the user to configure based on already predifiened pairs of colors... also the sixel situation is something that delays the whole custom icon-theme-packs thingy image

GiorgosXou commented 4 months ago

I let this profile-parser here for future reference, but i won't integrate it yet, because i have to figure out what i've said above... + I don't think it's the right time yet considering the status of the project.

if isfile(f'{CONFIG_PATH}{sep}PROFILES'):
    with open(f'{CONFIG_PATH}{sep}PROFILES', 'r') as file:
        line = ''
        icon = ''
        pair = None
        call = ''
        name = ''
        tmpp = None
        for block_line in file:
            if not block_line.strip() == '{': continue # Start of a block
            while True:
                line = next(file)
                if line.startswith('name:'):
                    name = line[5:-1]
                    continue
                elif line.startswith('call:'):
                    call = line[5:-1]
                    if   call == 'DEFAULT_EDITOR': DEFAULT_EDITOR
                    elif call == 'DEFAULT_OPENER': DEFAULT_OPENER
                    continue
                elif line.startswith('pair:'):
                    pair = line[5:-1]
                    continue
                elif line.startswith('icon:'):
                    while True:
                        line = next(file)
                        if line.strip() == '}':break
                        icon += line
                    icon = icon[:-1]
                    break
                if line.strip() == '}':break
            if pair and call and icon:
                TUIFIProfiles[name] = TUIFIProfile(icon,int(pair),call)
            else: # Override existing profile
                tmpp = TUIFIProfiles[name]
                if pair: tmpp.color_map = int(pair)
                if icon: tmpp.text      = icon
                if call: tmpp.open_with = call
            icon = ''
            pair = None
            call = ''
            name = ''
            #TODO: setter getter to profile text
{
name::file
pair:4
}
{
name:/test
call:nvim
pair:2
icon:
 ┏━━━━━━┓ 
 ┃ TEST ┃ 
 ┇------┇ 
 ┗━━━━━━┛ 
}
GiorgosXou commented 1 month ago

Transparency will be available in the next version for sure image

Sigmanificient commented 1 month ago

Oh nice, maybe slightly hard to read. Hopefully you can provide a float value from 0 to 1

GiorgosXou commented 1 month ago

@Sigmanificient transparency depends on the configuration of your terminal + your compositing manager. tuifi will just use the default background via uc.use_default_colors() (with -1 instead of uc.COLOR_BLACK)

Sigmanificient commented 1 month ago

I know that kitty has a setting for opacity, which works with picom

GiorgosXou commented 1 month ago

Same thing with allacritty