mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2026-08-24 10:14:12 -05:00
5f2e723a6d6734e851cdee9ef7dd3519e4703031
A single-color gradient effect for segments too narrow for a real two-stop gradient to render as anything but a solid color: dark-gradient(#color) runs from that exact color to a darker shade, light-gradient(#color) to a lighter one. The shade drops (or raises) HCL lightness only, by a fraction of the base color's own headroom toward the target end, keeping hue exact and walking chroma down only as far as the sRGB gamut forces - blending toward black/white directly pulls chroma down with it, reading as the color going muddy rather than deepening/brightening. The reference delta is tuned so a 3-cell segment - the common case this exists for - lands its shade close to a just-noticeable-difference rather than a hard color swap; a width multiplier grows that delta for wider segments as a saturating curve (not linear growth with a hard clamp - that hit its clamp by ~15-20 cells and crushed every wider segment to the exact same near-white/near-black color, which is what "the gradient stops working on a larger segment" turned out to be), so a very wide segment still shades further than a moderately wide one while topping out at a moderate, recognizably-still-the- same-hue color instead of washing out to white or black. GradientLastForCells mirrors the same shading (for a given cell count) on the raw stop text, so powerline separators, diamond caps, and inline color-override edges (via a new gradientRenderCells package var in the terminal writer) line up with the color the body actually ends on for that segment's own width. GradientLast (no cell count - used by parentBackground/ parentForeground crossing into another segment, and wherever width isn't known) falls back to the narrowest, gentlest shade. WithGradientStops rebuilds a gradient string keeping its own prefix (linear-gradient, dark-gradient, or light-gradient), so resolving a palette-referenced stop (dark-gradient(p:teal)) keeps its darken semantics instead of silently becoming a plain linear-gradient - whole-string palette resolution only ever expanded a bare "p:name" that itself resolved to a gradient, never a "p:name" used as one stop inside a gradient literal, so a palette-referenced stop reached GradientLast unresolved and fell back to the raw, unshaded base color. linear-gradient itself goes back to requiring two or more stops; the single-stop overload it briefly had is now dark-gradient's job. Entire-Checkpoint: 85522027570b
This repo was made with love using GitKraken.
Sponsors
Join the community
What started as the offspring of oh-my-posh2 for PowerShell resulted in a cross platform, highly customizable and extensible prompt theme engine. After 4 years of working on oh-my-posh, a modern and more efficient tool was needed to suit my personal needs.
❤️ Support ❤️
- Show your love with a t-shirt!
- One time support, or a recurring donation?
Features
- Shell and platform agnostic
- Easily configurable
- The most configurable prompt utility
- Fast
- Secondary prompt
- Right prompt
- Transient prompt
Documentation
Reviews
Thanks
- Chris Benti providing the first influence to start oh-my-posh
- Keith Dahlby for creating posh-git and making life more enjoyable
- Robby Russell for creating oh-my-zsh, without him this would probably not be here
- Janne Mareike Koschinski for providing information on how to get certain information using Go (and the amazing README)
- Starship for doing great things
Description
The most customisable and low-latency cross platform/shell prompt renderer
bashcmdfishfish-shellgitgolanghacktoberfestnerd-fontsnushellpowerlinepowershellpromptprompt-toolkitshell-promptstarshiptooltipszsh
Readme
159 MiB
Languages
Go
66.1%
MDX
19.2%
JavaScript
9%
PowerShell
2%
Shell
1.7%
Other
1.7%
