mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
fix(settings): colour tiles show alpha as a checkerboard (#615)
General settings colour tiles (room fills and glow) paint their colour at its opacity over the checkerboard again, so "No light sources" at 0 % no longer looks like solid grey. The label ink is chosen from the visible colour (hex mixed with the checkerboard by alpha). Colour plates (flat-swatch without cover-swatch) stay solid — now witnessed by the - hp-color-opacity: one `_solidSwatch` condition drives background and opacity; cover-swatch keeps the checkerboard - editors/color-tile-ink.ts: pure isLightHex/colorTileInk, unit-tested - smoke_dialog_polish_605: tileAlpha, defaultsDiffer, noneInkDark, liveAlpha, platesFlat, plateSolid; oneSurface drops the opaque check - mutants M-615-tile, M-615-plate, M-615-label - USER-GUIDE (ru/en): "Colour tile" row; both changelogs Issue: #615 User-Visible: yes
This commit is contained in:
@@ -11558,6 +11558,45 @@ const MUTANT_DEFINITIONS = [
|
||||
replace: " onOpacity: (a) => this._setFillColor(key === 'light_on' ? 'light_off' : key, { c: v.c, a }),",
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'M-615-tile',
|
||||
guard: 'node demo/smoke_dialog_polish_605.mjs',
|
||||
because: '#615 AC1: плитка цвета General обязана показывать прозрачность шахматкой — '
|
||||
+ 'при 0 % видна одна шахматка, при 100 % плотный цвет. Если плитка снова считается '
|
||||
+ 'сплошной плашкой, «No light sources» на 0 % опять выглядит насыщенным серым, '
|
||||
+ 'а единственным признаком остаётся число рядом',
|
||||
patches: [{
|
||||
file: 'src/hp-color-opacity.ts',
|
||||
find: ' return this.flatSwatch && !this.coverSwatch;',
|
||||
replace: ' return this.flatSwatch;',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'M-615-plate',
|
||||
guard: 'node demo/smoke_dialog_polish_605.mjs',
|
||||
because: '#615 AC3 (б): режим шахматки привязан к cover-swatch, а плашки цвета '
|
||||
+ '(flat-swatch без cover-swatch) остаются сплошными при любом α. Если режим включается '
|
||||
+ 'по flat-swatch, шахматка протекает на Wall fill, фон и плашки Space/Room/Device — '
|
||||
+ 'до #615 это не проверял ни один смок',
|
||||
patches: [{
|
||||
file: 'src/hp-color-opacity.ts',
|
||||
find: ' return this.flatSwatch && !this.coverSwatch;',
|
||||
replace: ' return !this.flatSwatch && this.coverSwatch;',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'M-615-label',
|
||||
guard: 'npx tsc -p tsconfig.test.json && node scripts/fix-test-build.mjs '
|
||||
+ '&& node --test --test-name-pattern="#615" test/form-kit.test.mjs',
|
||||
because: '#615 AC2: подпись плитки выбирается по видимому цвету — hex, смешанному с '
|
||||
+ 'шахматкой по α. По одному hex тёмный цвет на 0 % получает белую подпись на светлой '
|
||||
+ 'шахматке, и название плитки пропадает',
|
||||
patches: [{
|
||||
file: 'src/editors/color-tile-ink.ts',
|
||||
find: ' const a = Number.isFinite(alpha) ? Math.min(1, Math.max(0, alpha)) : 1;',
|
||||
replace: ' const a = 1;',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'general-north-clear-writes-zero',
|
||||
guard: 'node demo/smoke_general_settings_form.mjs',
|
||||
|
||||
Reference in New Issue
Block a user