DevelopmentCool2449 / colorful-mode

🎨Preview any color in your buffer
GNU General Public License v3.0
55 stars 3 forks source link

Color Palette prefix used in demo screenshots #3

Closed AnweshGangula closed 2 months ago

AnweshGangula commented 2 months ago

Hi,

can you please provide the code for the color palette icon used for prefix in the demo screenshot?

demo screenshot

DevelopmentCool2449 commented 2 months ago

Sure

(setq colorful-prefix-string (concat (nerd-icons-faicon "nf-fae-palette_color") " "))
AnweshGangula commented 2 months ago

I'm getting the following error. Do I need to do anything in my config?

Symbol's function definition is void: nerd-icons-faicon

DevelopmentCool2449 commented 2 months ago

You need to install nerd-icons.el package and/or use a patched nerd font

Also you can use this:

(setq colorful-prefix-string " ")
AnweshGangula commented 2 months ago

Please note that I'm using a Windows PC. I installed both nerd-icons and one of the patched nerd fonts you mentioned, but still get the same error.

I also am not able to see the icons you added in the above response - (setq colorful-prefix-string " ")

DevelopmentCool2449 commented 2 months ago

I can't help so much since this feels more an issue with nerd-icons.el but this can help, try install Symbols Nerd Fonts Mono font and ensure your emacs is using a patched nerd font (not Symbols Nerd Fonts Mono).

and then use this in your config:

(setq colorful-prefix-string " ")
;; or tihs
(setq colorful-prefix-string (concat (nerd-icons-faicon "nf-fae-palette_color") " "))

Also as an aditional note: the screenshot was done in Windows and currently it works fine.

AnweshGangula commented 2 months ago

I was trying to figure out the issue but couldn't.

Can you help me with what you mean by patched nerd font? And how can is use that? - because I tried using (nerd-icons-font-family "Source Code Pro"), but all the icons went away

I can see that when I execute this command (C-c C-c) with insert I get the icon properly, but when I execute with concat the result is not rendered properly

Is this expected or does this mean I have some issue?

using result

(insert (nerd-icons-faicon "nf-fae-palette_color") " ")

result command output

using concat

(concat (nerd-icons-faicon "nf-fae-palette_color") " ")

concat result

AnweshGangula commented 2 months ago

I tried switching the font-family to a couple of other families to see if this works, but I still get the error Symbol's function definition is void: nerd-icons-faicon.

I also asked for what the issue could be in this superuser post and found that the icon might be specific to a font. So maybe this particular icon needs a specific font family?

Ignoring the font, the first issue to fix in my case is the Symbol's function definition is void: nerd-icons-faicon - which i'm not sure what I'm doing wrong

DevelopmentCool2449 commented 2 months ago

I was trying to figure out the issue but couldn't.

Can you help me with what you mean by patched nerd font? And how can is use that? - because I tried using (nerd-icons-font-family "Source Code Pro"), but all the icons went away

nerd-icons-font-family must be set to a downloaded font from nerd font webpage. it's optional setting it since it defaults to "Symbols Nerd Font Mono" which should already be installed.

I can see that when I execute this command (C-c C-c) with insert I get the icon properly, but when I execute with concat the result is not rendered properly

Is this expected or does this mean I have some issue?

it's an issue, you should probably use this in your early-init.el (prefer-coding-system 'utf-8)

and found that the icon might be specific to a font. So maybe this particular icon needs a specific font family?

It's not necessarily, nerd font already provides all the icons for this.

Ignoring the font, the first issue to fix in my case is the Symbol's function definition is void: nerd-icons-faicon - which i'm not sure what I'm doing wrong I tried switching the font-family to a couple of other families to see if this works, but I still get the error Symbol's function definition is void: nerd-icons-faicon.

You probably must use (require 'nerd-icons) in your config (or add the :demand t keyword if you use use-package)

if the problem persists then open an issue on nerd-icons.el repository since it is the best place to ask, you will have better answers there.

AnweshGangula commented 2 months ago

tried the early-init & :demant t approach you mentioned, still doesn't fix the issue. I raised an issue in the nerd-icons repo. And Thank you for your help @DevelopmentCool2449. Really appreciate you taking the time.