diff --git a/CommunityBugFixCollection/GammaCorrectedColorXLuminance.cs b/CommunityBugFixCollection/GammaCorrectedColorXLuminance.cs new file mode 100644 index 0000000..9a8d5fa --- /dev/null +++ b/CommunityBugFixCollection/GammaCorrectedColorXLuminance.cs @@ -0,0 +1,25 @@ +using Elements.Core; +using HarmonyLib; +using MonkeyLoader.Resonite; +using System; +using System.Collections.Generic; +using System.Text; + +namespace CommunityBugFixCollection +{ + [HarmonyPatchCategory(nameof(GammaCorrectedColorXLuminance))] + [HarmonyPatch(typeof(colorX), nameof(colorX.Luminance), MethodType.Getter)] + internal sealed class GammaCorrectedColorXLuminance : ResoniteMonkey + { + public override bool CanBeDisabled => true; + + private static bool Prefix(colorX __instance, out float __result) + { + __result = __instance.ConvertProfile(ColorProfile.Linear).BaseColor.Luminance; + + return false; + } + + private static bool Prepare() => Enabled; + } +} \ No newline at end of file