Feature: native colour picker for model tint in card editor
Replace the plain hex text input + static swatch with a native <input type="color"> (Bootstrap form-control-color) + text field combo. Clicking the swatch opens the browser's colour picker and updates the hex field in real-time. An × button clears the value back to null (no tint). The text field still accepts manual hex entry and the picker reflects the change on the next interaction. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -267,11 +267,20 @@ else
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Tint Colour</label>
|
||||
<div class="input-group">
|
||||
<input type="color"
|
||||
class="form-control form-control-color p-1"
|
||||
style="max-width:48px;cursor:pointer"
|
||||
title="Pick colour"
|
||||
value="@(_card.ModelTintColor ?? "#ffffff")"
|
||||
@oninput="e => _card.ModelTintColor = e.Value?.ToString()" />
|
||||
<input @bind="_card.ModelTintColor" class="form-control" placeholder="#RRGGBB" />
|
||||
@if (!string.IsNullOrWhiteSpace(_card.ModelTintColor))
|
||||
{
|
||||
<span class="input-group-text"
|
||||
style="background:@_card.ModelTintColor;width:36px;border:1px solid #ced4da;"></span>
|
||||
<button class="btn btn-outline-secondary" type="button"
|
||||
title="Clear tint (set to null)"
|
||||
@onclick="() => _card.ModelTintColor = null">
|
||||
<i class="bi bi-x-lg"></i>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
<div class="form-text">Multiplicative hex tint. Null = white (no tint).</div>
|
||||
|
||||
Reference in New Issue
Block a user