i have a function in which i used a struct to return it two values. now i want to call the function to work from a form and i have a problems with the function.
here are the codes:
here are the codes:
Code:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; public struct TriAnaSplit { public int col1; public int col2; }; public TriAnaSplit Triadic(int pivotcolor) { int TestVar1, TestVar2, pluscolor, mincolor; TriAnaSplit Tri_val; TestVar1 = pivotcolor + 120; if (TestVar1 <= 360) pluscolor = TestVar1; else pluscolor = TestVar1 - 360; TestVar2 = pivotcolor - 120; if (TestVar2 >= 0) mincolor = TestVar2; else mincolor = 360 - Math.Abs(TestVar2); Tri_val.col1 = pluscolor; Tri_val.col2 = mincolor; return Tri_val; }