You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’d like to propose expanding the lipgloss.Color(s string) color.Color function to support RGB and HSL string formats.
Some examples would look like this:
purple:=lipgloss.Color("rgb(170, 0, 160)") // This would be equal to "#aa00a0"green:=lipgloss.Color("hsl(133, 70%, 42%)") // This would be equal to "#20b641"
I suggest this because this would make it easier for me to generate colour themes more easily, especially with HSL. It means a user could provide a hue for a theme, and I could computationally generate the rest of the colours relative to that hue.
If you decide you like this idea, I’m be happy to implement the changes for the Color function myself. Let me know your thoughts :)
I’d like to propose expanding the lipgloss.Color(s string) color.Color function to support RGB and HSL string formats.
Some examples would look like this:
purple:=lipgloss.Color("rgb(170, 0, 160)") // This would be equal to "#aa00a0"green:=lipgloss.Color("hsl(133, 70%, 42%)") // This would be equal to "#20b641"
I suggest this because this would make it easier for me to generate colour themes more easily, especially with HSL. It means a user could provide a hue for a theme, and I could computationally generate the rest of the colours relative to that hue.
If you decide you like this idea, I’m be happy to implement the changes for the Color function myself. Let me know your thoughts :)
I have my routines use the tcell/color package to convert color names to hex values, and pass that to lipgloss. Similar to your idea, it would be great if lipgloss just did that for you. https://github.com/gdamore/tcell/blob/main/color/color.go
That's right. I've actually already forked lipgloss and implement the algorithms for rgb and hsl.
If you are interested in this implementation, I allowed myself to make a pull request. #719.
I'm alright with you rejecting my pull request, I just wanted to let you know you are free to use it and it wouldn't introduce a whole extra dependency.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hello Charm
I’d like to propose expanding the
lipgloss.Color(s string) color.Colorfunction to support RGB and HSL string formats.Some examples would look like this:
I suggest this because this would make it easier for me to generate colour themes more easily, especially with HSL. It means a user could provide a hue for a theme, and I could computationally generate the rest of the colours relative to that hue.
If you decide you like this idea, I’m be happy to implement the changes for the
Colorfunction myself. Let me know your thoughts :)All reactions