Browse Source

Add comment explaining rounding value selection

pull/8215/head
robloo 4 years ago
parent
commit
5e8f0fb701
  1. 4
      src/Avalonia.Controls.ColorPicker/Helpers/ColorHelper.cs

4
src/Avalonia.Controls.ColorPicker/Helpers/ColorHelper.cs

@ -64,6 +64,10 @@ namespace Avalonia.Controls.Primitives
// It is also needlessly large as there are only ~140 known/named colors.
// Therefore, rounding of the input color's component values is done to
// reduce the color space into something more useful.
//
// The rounding value of 5 is specially chosen.
// It is a factor of 255 and therefore evenly divisible which improves
// the quality of the calculations.
double rounding = 5;
var roundedColor = new Color(
0xFF,

Loading…
Cancel
Save