예제 #1
0
        private static Color AlterColor(Color origColor, bool random)
        {
            if (random)
            {
                return(new Color(RandomUtil.GetInt(255), RandomUtil.GetInt(255), RandomUtil.GetInt(255)));
            }
            else
            {
                // mSavedColors is a Vector color stored as RGB ratios of 0 to 1

                Vector3 hsv = CompositorUtil.ColorShifter.ColorToHsv(CompositorUtil.ColorToVector3(origColor));

                /*
                 * hsv.x += RandomUtil.GetFloat(-0.01f, 0.01f);
                 * if (hsv.x > 1)
                 * {
                 *  hsv.x = 1;
                 * }
                 * else if (hsv.x < 0)
                 * {
                 *  hsv.x = 0;
                 * }
                 */

                hsv.y += RandomUtil.GetFloat(-0.25f, 0.25f);
                if (hsv.y > 1)
                {
                    hsv.y = 1;
                }
                else if (hsv.y < 0.01)
                {
                    hsv.y = 0.01f;
                }

                hsv.z += RandomUtil.GetFloat(-0.25f, 0.25f);
                if (hsv.z > 1)
                {
                    hsv.z = 1;
                }
                else if (hsv.z < 0.01)
                {
                    hsv.z = 0.01f;
                }

                return(CompositorUtil.Vector3ToColor(CompositorUtil.ColorShifter.HsvToColor(hsv)));
            }
        }
예제 #2
0
        private static Color[] GetMakeupColors(CASMakeup ths, BodyTypes type)
        {
            Vector3[] makeupVectorColors = GetMakeupVectorColors(ths, type);
            if (makeupVectorColors == null)
            {
                return(null);
            }
            int length = makeupVectorColors.Length;

            if (CASController.Singleton.ShowAllMakeupPresetsCheat)
            {
                length = 0x4;
            }
            Color[] colorArray = new Color[length];
            for (int i = 0x0; i < makeupVectorColors.Length; i++)
            {
                colorArray[i] = CompositorUtil.Vector3ToColor(makeupVectorColors[i]);
            }
            for (int j = makeupVectorColors.Length; j < length; j++)
            {
                colorArray[j] = new Color(0xffffffff);
            }
            return(colorArray);
        }