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

[Feature Request] Allow us to add own custom colours #3

Open
gusbemacbe opened this issue Feb 21, 2022 · 7 comments
Open

[Feature Request] Allow us to add own custom colours #3

gusbemacbe opened this issue Feb 21, 2022 · 7 comments

Comments

@gusbemacbe
Copy link

gusbemacbe commented Feb 21, 2022

Hello,

Give a look at the example of ohmyzsh/plugins/web-search and go to the end of README where ZSH_WEB_SEARCH_ENGINES allows us to add other search engine contexts.

I would do like:

autoload colors
colors

c=(
    skyblue_hex '%F{#87afdf}'
    piltover_hex '%F{#858569}'

    skyblue_ansi '�[38;2;15;161;166m'
    piltover_ansi '�[38;2;133;133;105m'
)

And it looks like:

echo $c[red] Red colour $c[default]and $c[piltover]Piltover‘s colour. $c[reset]
  • Mix of zpm-zsh's colors with colour functions:
    image

  • Using ZSH's colour hexadecimal codes, but it requires print -P. And using ANSI RGB code does not require print -P:

    image

@gusbemacbe
Copy link
Author

Hello @grigorii-horos, any chance?

@grigorii-horos
Copy link
Member

Hey @gusbemacbe . c is just avariable. You can easy extent it using own colors

c+=(skyblue_hex '%F{#87afdf}')

@gusbemacbe
Copy link
Author

Hello @grigorii-horos

It does not work yet:

image

The code is in the first file called 01-cores:

autoload colors
colors
c+=(skyblue_hex '%F{#87afdf}')
c+=(piltover_hex '%F{#7c6c48}')

The files are sourced in the sixth file called 06-fontes plugged by @marlonrichert's znap.

source $HOME/.znap/colors/colors.plugin.zsh
source $HOME/.config/zsh/config.d/01-cores.zsh

The plugin zpm-zsh/colors is located in the fifth file called 05-plugins.

image

I used @marlonrichert's znap.

@gusbemacbe
Copy link
Author

It seems that it is possible only with print -P:

image

But echo did work with new custom colours as you saw the first image.

@grigorii-horos
Copy link
Member

I don't know how it was realized in another plugin (%F{#87afdf})

Try

    c+=(skyblue_ansi '�[38;2;15;161;166m')
    c+=(piltover_ansi '�[38;2;133;133;105m')

@gusbemacbe
Copy link
Author

It does not work either, @grigorii-horos:

image

Maybe it must be @marlonrichert's znap or my zsh configuration. I'll leave my zipped file for both you to analyse.

my_zsh.zip

@marlonrichert
Copy link

@gusbemacbe No idea why you are tagging me or what this is about, but if you think it’s a bug in Znap, please open an issue over there.

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