YUICompressor-NET / YUICompressor.NET

Port of Yahoo!'s Java YUICompressor to .NET
BSD 3-Clause "New" or "Revised" License
122 stars 61 forks source link

The compressed RGBA color value is incorrect. #40

Closed 1123612483 closed 3 years ago

1123612483 commented 3 years ago

If the RGB value (the first 6 bits of the value) are the same, the RGBA value (8-bit value) is compressed to 5 bits by the compressor. @PureKrome

    class Program
    {
        static string CompressCSS()
        {
            var css = @"
                a {
                    background: #F9BE4486;
                    color: #FFFFFF20;
                }";
            var compressor = new CssCompressor();
            // The background value is correct.
            // The expected result of color is #FFFFFF20, and the actual result is #FFF20.
            var compressedCSS = compressor.Compress(css); // a{background:#F9BE4486;color:#FFF20}

            return compressedCSS;
        }
    }
PureKrome commented 3 years ago

Hi @1123612483 - thanks heaps for the bug report.

Unfortunately, this repo is now more in an archive-not-maintained state. I'll happily review and accept PR's but I don't have the capacity for actually working on this repo.

PureKrome commented 3 years ago

Good news @1123612483 - a new version 3.1.0 is now up on NuGet.org.

🍰 thanks heaps for the PR!

PureKrome commented 3 years ago

Fixed by #41