private void TbAlphaScroll(object sender, EventArgs e) { changeType = ChangeStyle.RGB; argb = new ColorHandler.ARGB(tbAlpha.Value, tbRed.Value, tbGreen.Value, tbBlue.Value); RefreshText(lblAlpha, tbAlpha.Value); tbHexCode.Text = string.Format("{0:X2}{1:X2}{2:X2}{3:X2}", argb.Alpha, argb.Red, argb.Green, argb.Blue); Invalidate(); }
private void HandleRGBScroll(object sender, EventArgs e) { // If the R, G, or B values change, use this // code to update the HSV values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. changeType = ChangeStyle.RGB; argb = new ColorHandler.ARGB(tbAlpha.Value, tbRed.Value, tbGreen.Value, tbBlue.Value); SetHSV(ColorHandler.RGBtoHSV(argb)); SetRGBLabels(argb); Invalidate(); }