agy-powerline 1.9.1 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/lib/colors.js +8 -3
- package/src/lib/layouts/pills.js +11 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.9.2] - 2026-10-28
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Pills' meter dots stand out on every pill: filled dots take the pill's text color and empty ones a fainter shade of it, at 3:1 contrast or more, where light dots used to fade on the bright pills of dark themes and dark dots on the deep pills of light themes (#168)
|
|
13
|
+
|
|
8
14
|
## [1.9.1] - 2026-10-28
|
|
9
15
|
|
|
10
16
|
### Fixed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agy-powerline",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.2",
|
|
4
4
|
"description": "agy statusline for Google Antigravity CLI: live Gemini, Claude/GPT and Argon quota pacing, git, themes and an interactive TUI configurator",
|
|
5
5
|
"bin": {
|
|
6
6
|
"agy-powerline": "src/index.js"
|
package/src/lib/colors.js
CHANGED
|
@@ -303,12 +303,17 @@ function readableText(background, preferred, fallbacks) {
|
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
// The color moved toward white (on a dark background) or black (on a light
|
|
306
|
-
// one) just far enough to reach the minimum
|
|
307
|
-
|
|
306
|
+
// one), or toward the given target, just far enough to reach the minimum
|
|
307
|
+
// contrast.
|
|
308
|
+
function withContrast(
|
|
309
|
+
color,
|
|
310
|
+
background,
|
|
311
|
+
min = MIN_CONTRAST,
|
|
312
|
+
target = luminance(background) < 0.5 ? [255, 255, 255] : [0, 0, 0]
|
|
313
|
+
) {
|
|
308
314
|
if (contrastRatio(color, background) >= min) {
|
|
309
315
|
return color;
|
|
310
316
|
}
|
|
311
|
-
const target = luminance(background) < 0.5 ? [255, 255, 255] : [0, 0, 0];
|
|
312
317
|
for (let step = 1; step <= 20; step++) {
|
|
313
318
|
const moved = mix(color, target, step / 20);
|
|
314
319
|
if (contrastRatio(moved, background) >= min) {
|
package/src/lib/layouts/pills.js
CHANGED
|
@@ -17,6 +17,7 @@ const {
|
|
|
17
17
|
getActiveDepth,
|
|
18
18
|
gradientColors,
|
|
19
19
|
readableText,
|
|
20
|
+
withContrast,
|
|
20
21
|
} = require("../colors");
|
|
21
22
|
const { gradientStops } = require("../themes");
|
|
22
23
|
const { pickGlyph, glyphChar } = require("../powerline");
|
|
@@ -79,7 +80,8 @@ function fillMeter(pct, width, fillColor, emptyColor, segmentColor, pace = {}) {
|
|
|
79
80
|
// pips, the default, needs a Unicode font: ASCII mode keeps the cells.
|
|
80
81
|
const pips = pace.style === "pips";
|
|
81
82
|
if (pips && !pace.ascii && getActiveDepth() !== "none") {
|
|
82
|
-
|
|
83
|
+
const track = withContrast(segmentColor, segmentColor, PIP_CONTRAST, pace.textColor);
|
|
84
|
+
return pipMeter(used, marker, width, pace.textColor, track) + bg(segmentColor);
|
|
83
85
|
}
|
|
84
86
|
if (METER_STYLES[pace.style] && !(pips && pace.ascii)) {
|
|
85
87
|
return glyphMeter(used, marker, width, METER_STYLES[pace.style], pace);
|
|
@@ -101,9 +103,14 @@ function fillMeter(pct, width, fillColor, emptyColor, segmentColor, pace = {}) {
|
|
|
101
103
|
return meter + bg(segmentColor);
|
|
102
104
|
}
|
|
103
105
|
|
|
104
|
-
// Small dots on the pill's own color: the filled ones in the
|
|
105
|
-
// the rest in the
|
|
106
|
-
//
|
|
106
|
+
// Small dots on the pill's own color: the filled ones in the pill's text color,
|
|
107
|
+
// the rest in the pill's color moved toward it until they reach 3:1 (WCAG's
|
|
108
|
+
// minimum for graphics). A light fill and a dark track can't both stand out
|
|
109
|
+
// on every pill: on a bright one the light dots fade, on a deep one the dark
|
|
110
|
+
// ones do. The pace marker is a larger dot in the other color, so nothing in
|
|
111
|
+
// the meter is a line.
|
|
112
|
+
const PIP_CONTRAST = 3;
|
|
113
|
+
|
|
107
114
|
function pipMeter(used, marker, width, fillColor, emptyColor) {
|
|
108
115
|
let meter = "";
|
|
109
116
|
let color = null;
|