c# - Improve Color Shades and Tints Algorithm Using RGB Values -
I used to find different forms and tints of a chosen color, but now I have to improve I hope that the algorithm Ranges in the middle class (with RGB which increase from about 400 to 500) produce good results, such as in 2 and 4 rows. But the color outside the range gives some more results, which you see in lines 1 and 3, where the light color does not fade too much. I think I need to adjust my multiplier to fix this problem, but my math skills are not yet.
private void Meetsheets Endnotes (Color C) {int i; Double m; Int r; Int g; Int b; For (i = 1; i <21; i ++) {m = i * 0.1; R = (int) (c r * m); If (R & G; 255) R = 255; G = (int) (cg * m); If (g> 255) g = 255; B = (int) (cb * m); If (b> 255) b = 255; ColorList.Add (Color.FromArgb (R, G, B)); }}
If you want to try it for yourself, then the complete code is available here:
What I know from here is a way of increasing darkness in the shadows: -
get private zeros (color C) {int I; Double factor; Int r; Int g; Int b; For (i = 20; i> = 0; i--) {factor = i / 20; R = (int) (c * r * factor); If (R & G; 255) R = 255; G = (int) (cg * factor); If (g> 255) g = 255; B = (int) (cb * factor); If (b> 255) b = 255; ColorList.Add (Color.FromArgb (R, G, B)); }} Explanation: The brightness of the color is changing in its proportion, therefore, depending on the magnitude of RGB only, without multiplying by factor in (0,1) That you are Note: What you have done works fine to make tintes from pure colors.
Comments
Post a Comment