style(grid): brighter major grid
grid_major 0x2A3038 -> 0x39414C, still well under axis_line's 0x8A94A6, so the three-way hierarchy the eye reads stays minor < major < axis. Already fully opaque, so "more prominent" meant a brighter colour and nothing else. The tests that classify grid pixels take their colours from the style, so they followed the change; the one hardcoded mention (grid_pixel()'s doc comment) is updated, and the minor's relationship to the major is now stated as an order of magnitude rather than the fifth the old colours happened to give. 361 cases, 0 failed.
This commit is contained in:
1 parent
01e410bd74
commit
c4c0a49466
3 files changed
+14
-8
No files matched your search
+2
-2
@@ -36,7 +36,7 @@ Colours (neither logical nor device — nothing to scale):
|
|||||||
| field | default | meaning |
|
| field | default | meaning |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `background` | `0x101418` | frame clear colour and legend/readout panel base |
|
| `background` | `0x101418` | frame clear colour and legend/readout panel base |
|
||||||
| `grid_major` | `0x2A3038` | major (labelled-tick) grid lines |
|
| `grid_major` | `0x39414C` | major (labelled-tick) grid lines |
|
||||||
| `grid_minor` | `0x1C2126` at 50% alpha | minor (subdivision) grid lines |
|
| `grid_minor` | `0x1C2126` at 50% alpha | minor (subdivision) grid lines |
|
||||||
| `axis_line` | `0x8A94A6` | axis lines |
|
| `axis_line` | `0x8A94A6` | axis lines |
|
||||||
| `axis_text` | `0xC8D0DC` | tick labels and axis titles |
|
| `axis_text` | `0xC8D0DC` | tick labels and axis titles |
|
||||||
@@ -99,7 +99,7 @@ grid's three defaults are what makes that read: it is thinner than the major hai
|
|||||||
display as a narrower line), its colour carries an **alpha** so it blends into the
|
display as a narrower line), its colour carries an **alpha** so it blends into the
|
||||||
background instead of sitting on it, and it is **dashed** (`grid_minor_dash_on`/`_off`) so an
|
background instead of sitting on it, and it is **dashed** (`grid_minor_dash_on`/`_off`) so an
|
||||||
unlabelled line at an unlabelled position is never mistaken for a labelled one. Together
|
unlabelled line at an unlabelled position is never mistaken for a labelled one. Together
|
||||||
those put a minor line at roughly a fifth of a major line's ink — at full opacity and the
|
those put a minor line at an order of magnitude less ink than a major one — at full opacity and the
|
||||||
same width a dense minor grid reads as a second set of ticks. The dash is a fragment-shader
|
same width a dense minor grid reads as a second set of ticks. The dash is a fragment-shader
|
||||||
discard, not extra geometry: the vertices are the line either way. Set
|
discard, not extra geometry: the vertices are the line either way. Set
|
||||||
`grid_minor_dash_off = 0` for the old solid subdivision.
|
`grid_minor_dash_off = 0` for the old solid subdivision.
|
||||||
|
|||||||
@@ -38,13 +38,18 @@ struct Style {
|
|||||||
// --- colours: neither logical nor device, so nothing to scale ------------
|
// --- colours: neither logical nor device, so nothing to scale ------------
|
||||||
|
|
||||||
Color background = Color::hex(0x101418);
|
Color background = Color::hex(0x101418);
|
||||||
Color grid_major = Color::hex(0x2A3038);
|
/// The labelled grid. Brighter than the subdivisions and still well under `axis_line`
|
||||||
|
/// (0x8A94A6): the grid is structure the eye can read, the axis is the frame, and the
|
||||||
|
/// hierarchy between the three is what keeps a dense plot legible. It is already fully
|
||||||
|
/// opaque, so "more prominent" means a brighter colour and nothing else.
|
||||||
|
Color grid_major = Color::hex(0x39414C);
|
||||||
/// The minor grid's colour, **with an alpha** so it blends into the background rather than
|
/// The minor grid's colour, **with an alpha** so it blends into the background rather than
|
||||||
/// sitting on it: a subdivision is a reading aid, and at full opacity a dense minor grid
|
/// sitting on it: a subdivision is a reading aid, and at full opacity a dense minor grid
|
||||||
/// reads as a second set of ticks competing with the labelled one. The line shader applies
|
/// reads as a second set of ticks competing with the labelled one. The line shader applies
|
||||||
/// `u_color.a` (see `src/render/shaders.cpp`), so this one blends and the major -- opaque at
|
/// `u_color.a` (see `src/render/shaders.cpp`), so this one blends and the major -- opaque at
|
||||||
/// 0x2A3038 -- stays the structure the eye picks out. Together with `grid_minor_width` and
|
/// 0x39414C -- stays the structure the eye picks out. Together with `grid_minor_width` and
|
||||||
/// the dash below, the defaults put a minor line at roughly a fifth of a major line's ink.
|
/// the dash below, the defaults put a minor line at an order of magnitude less ink than a
|
||||||
|
/// major one.
|
||||||
Color grid_minor = Color::hex(0x1C2126, 0.5f);
|
Color grid_minor = Color::hex(0x1C2126, 0.5f);
|
||||||
Color axis_line = Color::hex(0x8A94A6);
|
Color axis_line = Color::hex(0x8A94A6);
|
||||||
Color axis_text = Color::hex(0xC8D0DC);
|
Color axis_text = Color::hex(0xC8D0DC);
|
||||||
|
|||||||
@@ -5481,9 +5481,10 @@ plot::i32 densest_column(const std::vector<plot::u8>& frame, plot::u32 fb_w, plo
|
|||||||
return best;
|
return best;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The grid *majors* (0x2A3038 over the 0x101418 background), which no other element of these
|
/// The grid *majors* (0x39414C over the 0x101418 background), which no other element of these
|
||||||
/// frames reaches: the minors are 0x1C2126 (too dark for the bound), the crosshair is near-white,
|
/// frames reaches: the minors are that same colour at 50% alpha over a 0.75-covered dashed
|
||||||
/// a trace is saturated and the cursor is the orange accent.
|
/// stroke, so their brightest pixel is about 15 levels off the background and stays under this
|
||||||
|
/// bound; the crosshair is near-white, a trace is saturated and the cursor is the orange accent.
|
||||||
bool grid_pixel(const plot::u8 px[4]) {
|
bool grid_pixel(const plot::u8 px[4]) {
|
||||||
const plot::u8 lo = std::min(px[0], std::min(px[1], px[2]));
|
const plot::u8 lo = std::min(px[0], std::min(px[1], px[2]));
|
||||||
const plot::u8 hi = std::max(px[0], std::max(px[1], px[2]));
|
const plot::u8 hi = std::max(px[0], std::max(px[1], px[2]));
|
||||||
|
|||||||
Reference in new issue
Block a user