JBooth.VertexPainterPro.VertexPainterWindow.UV1_AsColorRGBADesaturate C# (CSharp) Method

UV1_AsColorRGBADesaturate() static private method

static private UV1_AsColorRGBADesaturate ( PaintJob j, int idx, object &v, float r ) : void
j PaintJob
idx int
v object
r float
return void
        static void UV1_AsColorRGBADesaturate(PaintJob j, int idx, ref object v, float r)
        {
            var st = j.stream;
             float h, s, b;
             Vector4 vec = st.uv1[idx];
             Color c = new Color(vec.x, vec.y, vec.z);
             Color.RGBToHSV(c, out h, out s, out b);
             s = Mathf.Lerp(s, 0.0f, r);
             c = Color.HSVToRGB(h, s, b);
             st.uv1[idx] = new Vector4(c.r, c.g, c.b, vec.w);
        }