/// <summary> /// Update Human energy colors from the given base colors. /// </summary> /// <param name="blueColor">Blue sword spin energy color.</param> /// <param name="redColor">Red sword spin energy color.</param> void SetHumanEnergyColors(Color blueColor, Color redColor) { var converter = new ColorSpaceConverter(); var blueAdjusted = converter.TranslateHsv(blueColor, hsv => new Hsv(hsv.H, Increase(hsv.S), Increase(hsv.V))); var redAdjusted = converter.TranslateHsv(redColor, hsv => new Hsv(hsv.H, Increase(hsv.S), Increase(hsv.V))); // Update color for normal spin. Colors.SwordEnergyBlueEnv1 = blueColor; Colors.SwordEnergyBlueEnv2 = blueAdjusted; Colors.SwordEnergyBluePrim = Color.White; // Update color for greater spin. Colors.SwordEnergyRedEnv1 = redColor; Colors.SwordEnergyRedEnv2 = redAdjusted; Colors.SwordEnergyRedPrim = Color.White; // Update color for sword charge effect. Colors.SwordChargeBlueEnergyEnv = blueColor; Colors.SwordChargeBlueEnergyPrim = Color.White; Colors.SwordChargeRedEnergyEnv = redColor; Colors.SwordChargeRedEnergyPrim = Color.White; // Update color for sword charge sparks. Colors.SwordChargeSparksBlue = blueAdjusted; Colors.SwordChargeSparksRed = redAdjusted; float Increase(float input, float mult = 3f) => Math.Min(input * mult, 1f); }
/// <summary> /// Update Zora energy colors from the given base color. /// </summary> /// <param name="color">Base color.</param> void SetZoraEnergyColors(Color color) { var converter = new ColorSpaceConverter(); var darker = converter.TranslateHsv(color, hsv => new Hsv((hsv.H + 35f) % 360f, hsv.S, hsv.V * 0.392f)); Colors.ZoraEnergyEnv1 = darker; Colors.ZoraEnergyEnv2 = color; Colors.ZoraEnergyPrim1 = color; // Use white for safety. Todo: Add option to use black for neat effect? Colors.ZoraEnergyPrim2 = Color.White; }
/// <summary> /// Set Goron energy colors from the given options. /// </summary> /// <param name="options">Color options.</param> void SetGoronEnergyColors(GoronColorOptions options) { Colors.GoronPunchEnergyPrim = GetPunchPrim(options.Main); Colors.GoronPunchEnergyEnv1 = options.Extra1; Colors.GoronPunchEnergyEnv2 = options.Extra1; var inner = Mix(options.Main, Colors.GoronRollInnerEnergyEnv); Colors.GoronRollInnerEnergyEnv = inner.Item1; Colors.GoronRollInnerEnergyPrim = inner.Item2; var outer1 = Mix(options.Extra1, Colors.GoronRollOuterEnergyEnv1); Colors.GoronRollOuterEnergyEnv1 = outer1.Item1; Colors.GoronRollOuterEnergyPrim1 = outer1.Item2; var outer2 = Mix(options.Extra2, Colors.GoronRollOuterEnergyEnv2); Colors.GoronRollOuterEnergyEnv2 = outer2.Item1; Colors.GoronRollOuterEnergyPrim2 = outer2.Item2; Color GetPunchPrim(Color color) { var converter = new ColorSpaceConverter(); return(converter.TranslateHsv(color, hsv => new Hsv(hsv.H, (hsv.S / 5f) * 4f, hsv.V))); } (Color env, Color prim) Mix(Color color, Color env) { // Convert color values to HSV. var converter = new ColorSpaceConverter(); var curHsv = converter.ToHsv(color); var envHsv = converter.ToHsv(env); // Calculate delta of Value. var envHsvValDelta = ((curHsv.V + envHsv.V) / 2f) - curHsv.V; // Multiply by Saturation to limit deviation of Value for greyscale-approaching colors (Saturation approaching 0). var envHsvValue = options.MixEnvValue ? curHsv.V + (envHsvValDelta * curHsv.S) : curHsv.V; // Build new colors from HSV. var envResultHsv = new Hsv(curHsv.H, curHsv.S, envHsvValue); var primResultHsv = new Hsv(curHsv.H, curHsv.S, curHsv.V); // Convert back into RGB. var envResult = converter.ToColor(envResultHsv); var primResult = converter.ToColor(primResultHsv); return(envResult, primResult); } }
/// <summary> /// Update Fierce Deity energy colors from the given base color. /// </summary> /// <param name="color">Sword beam energy color.</param> void SetFierceDeityEnergyColors(Color color) { var converter = new ColorSpaceConverter(); var adjusted = converter.TranslateHsv(color, hsv => new Hsv(hsv.H, Increase(hsv.S), Increase(hsv.V))); // Update sword beam damage colors. Colors.SwordBeamDamageEnv = adjusted; // Update sword beam energy colors. Colors.SwordBeamEnergyEnv = color; Colors.SwordBeamEnergyPrim = Color.White; // Update sparkle colors. Colors.FierceDeitySparklesInner = color.Brighten(0.5f); Colors.FierceDeitySparklesOuter = color; float Increase(float input, float mult = 3f) => Math.Min(input * mult, 1f); }