val:<span>@val</span><br>
<ColorPicker @bind-Value="val"></ColorPicker>
@code {
private string val;
}
val:<span>@val</span><br>
<ColorPicker @bind-Value="val" Options="options"></ColorPicker>
@code {
private string val="rgba(46,255,81,0.61)";
ColorPickerOptions options = new()
{
Format = "rgba",
PointerBorderWidth = 2
};
}
自定义颜色块
val:<p>自定义颜色块</p>
val:<span>@val</span><br>
<ColorPicker @bind-Value="val" Options="options"></ColorPicker>
@code {
private string val="";
ColorPickerOptions options = new()
{
Palette = new []{"#fff","#000","#808080","#996e36","#f55525",
"#ffe438","#88dd20","#22e0cd","#269aff","#bb1cd4"},
};
}
文档