Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I change the default colors? #38

Closed
yochananmarqos opened this issue Dec 30, 2022 · 14 comments
Closed

How do I change the default colors? #38

yochananmarqos opened this issue Dec 30, 2022 · 14 comments

Comments

@yochananmarqos
Copy link

You said:

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

So I did.

@GiorgosXou
Copy link
Owner

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
Copy link
Owner

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

@GiorgosXou
Copy link
Owner

GiorgosXou commented Apr 10, 2024

unicurses/unicurses#41

@GiorgosXou
Copy link
Owner

GiorgosXou commented Apr 10, 2024

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
Copy link
Owner

GiorgosXou commented Apr 12, 2024

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
Copy link
Owner

GiorgosXou commented Apr 20, 2024

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
Copy link
Owner

Transparency will be available in the next version for sure
image

@Sigmanificient
Copy link
Contributor

Sigmanificient commented Jul 9, 2024

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

@GiorgosXou
Copy link
Owner

GiorgosXou commented Jul 9, 2024

@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
Copy link
Contributor

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

@GiorgosXou
Copy link
Owner

Same thing with allacritty

@GiorgosXou
Copy link
Owner

GiorgosXou commented Oct 7, 2024

So, yeah... I've just implemented a theming mechanism. But, the range of RGB-colors is quite limmited... and for some reason init_extended_color refuses to work with values greater than 1000
tuifi_theme_blue_Peek 2024-10-08 02-53

@GiorgosXou
Copy link
Owner

tuifi_theming_Peek 2024-10-08 03-13

@GiorgosXou
Copy link
Owner

getting closer...
tuifi_theme_Peek 2024-10-08 20-02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants