How to do I change label color and make the label visible if user chooses dark background color.
For instance, if I choose black color from ColorPickerExtender the label color should change to white.
It’s just to adjust the label color to adjust to background color.
<asp:TextBox ID="TextBox1" runat="server" AutoCompleteType="None" Font-Size="4pt" CssClass="form-control" />
<cc1:ColorPickerExtender ID="ColorPicker1" runat="server" TargetControlID="TextBox1"
PopupButtonID="ColorBtn" PopupPosition="TopRight" OnClientColorSelectionChanged="LabelColor" />
<div class="input-group-append">
<span class="input-group-text" id="ColorBtn" runat="server" style="height: auto; background-color: transparent; color: #404344;">
<span id="toggle_picker" class="fad fa-eye-dropper" aria-hidden="true" style="cursor: pointer; font-size: 10pt; border: none;"></span></span>
</div>
<script type="text/javascript">
function LabelColor(sender) {
document.getElementById("bgCard").style.backgroundColor = "#" + sender.get_selectedColor();
document.getElementById("lblName").style.color = "#ffffff;"; //I tried to do this, but it did not work.
}
</script>