diff --git a/Assets/TransparencyConverter/Documentation~/TransparencyConverter.pdf b/Assets/TransparencyConverter/Documentation~/TransparencyConverter.pdf index b73dcca..bccabd0 100644 Binary files a/Assets/TransparencyConverter/Documentation~/TransparencyConverter.pdf and b/Assets/TransparencyConverter/Documentation~/TransparencyConverter.pdf differ diff --git a/Assets/TransparencyConverter/Documentation~/TransparencyConverter.pptx b/Assets/TransparencyConverter/Documentation~/TransparencyConverter.pptx index c2b0d8c..b40523f 100644 Binary files a/Assets/TransparencyConverter/Documentation~/TransparencyConverter.pptx and b/Assets/TransparencyConverter/Documentation~/TransparencyConverter.pptx differ diff --git a/Assets/TransparencyConverter/Runtime/Scripts/TransparencyConverter.cs b/Assets/TransparencyConverter/Runtime/Scripts/TransparencyConverter.cs index bedcc4a..53887b1 100644 --- a/Assets/TransparencyConverter/Runtime/Scripts/TransparencyConverter.cs +++ b/Assets/TransparencyConverter/Runtime/Scripts/TransparencyConverter.cs @@ -42,16 +42,9 @@ public static float SRGBToLinear(float alpha_srgb, Vector3 foregroundColor, Vect } // Calculate transparency value - if (c <= 0.04045) - { - return alpha_srgb; - } - else - { - var numerator = (Math.Pow((c + 0.055) / 1.055, 2.4) - Math.Pow((cb + 0.055) / 1.055, 2.4)); - var denominator = (Math.Pow((cf + 0.055) / 1.055, 2.4) - Math.Pow((cb + 0.055) / 1.055, 2.4)); - return (float)(numerator / denominator); - } + var numerator = (Math.Pow((c + 0.055) / 1.055, 2.4) - Math.Pow((cb + 0.055) / 1.055, 2.4)); + var denominator = (Math.Pow((cf + 0.055) / 1.055, 2.4) - Math.Pow((cb + 0.055) / 1.055, 2.4)); + return (float)(numerator / denominator); } public static float SRGBToLinearApproximately(float alpha_srgb, Vector3 foregroundColor, Vector3 backgroundColor) diff --git a/Assets/TransparencyConverter/package.json b/Assets/TransparencyConverter/package.json index 4fb60b8..f0ac981 100644 --- a/Assets/TransparencyConverter/package.json +++ b/Assets/TransparencyConverter/package.json @@ -1,6 +1,6 @@ { "name": "jp.sotanmochi.transparencyconverter", - "version": "0.3.1", + "version": "0.3.2", "displayName": "TransparencyConverter", "description": "Calculate the transparency value in linear color space from the value in sRGB color space.", "license": "MIT",