<script>
document.addEventListener('DOMContentLoaded', () => {
    const icon = document.getElementById('brxe-enyccb');

    function getAverageRGB(imgEl) {
        var blockSize = 5, // only visit every 5 pixels
            defaultRGB = {r:0,g:0,b:0}, // for non-supporting envs
            canvas = document.createElement('canvas'),
            context = canvas.getContext && canvas.getContext('2d'),
            data, width, height,
            i = -4,
            length,
            rgb = {r:0,g:0,b:0},
            count = 0;

        if (!context) {
            return defaultRGB;
        }

        height = canvas.height = imgEl.naturalHeight || imgEl.offsetHeight || imgEl.height;
        width = canvas.width = imgEl.naturalWidth || imgEl.offsetWidth || imgEl.width;

        context.drawImage(imgEl, 0, 0);

        try {
            data = context.getImageData(0, 0, width, height);
        } catch(e) {
            return defaultRGB;
        }

        length = data.data.length;

        while ( (i += blockSize * 4) < length ) {
            ++count;
            rgb.r += data.data[i];
            rgb.g += data.data[i+1];
            rgb.b += data.data[i+2];
        }

        rgb.r = ~~(rgb.r/count);
        rgb.g = ~~(rgb.g/count);
        rgb.b = ~~(rgb.b/count);

        return rgb;
    }

    function getContrastYIQ(rgb) {
        var yiq = ((rgb.r*299)+(rgb.g*587)+(rgb.b*114))/1000;
        return (yiq >= 128) ? 'black' : 'white';
    }

    function checkBackgroundColor() {
        const imgEl = document.querySelector('body'); // Adjust to capture your page background
        const rgb = getAverageRGB(imgEl);
        const contrastColor = getContrastYIQ(rgb);
        icon.style.color = contrastColor;
    }

    window.addEventListener('scroll', checkBackgroundColor);
    window.addEventListener('resize', checkBackgroundColor);

    checkBackgroundColor(); // Initial check
});

</script>

Terms & Conditions

These terms and conditions (the “Terms and Conditions”) govern the use of Salmon  Studios Website (the “Site”). This Site is owned and operated by Salmon Studios Ltd. This  Site is a portfolio. 

By using this Site, you indicate that you have read and understand these Terms and  Conditions and agree to abide by them at all times. 

THESE TERMS AND CONDITIONS CONTAIN A DISPUTE RESOLUTION CLAUSE  THAT IMPACTS YOUR RIGHTS ABOUT HOW TO RESOLVE DISPUTES. PLEASE  READ IT CAREFULLY. 

Limitation of Liability 

Salmon Studios Ltd and our directors, officers, agents, employees, subsidiaries, and  affiliates will not be liable for any actions, claims, losses, damages, liabilities and expenses  including legal fees from your use of the Site.  

Indemnity 

Except where prohibited by law, by using this Site you indemnify and hold harmless  Salmon Studios Ltd and our directors, officers, agents, employees, subsidiaries, and  affiliates from any actions, claims, losses, damages, liabilities and expenses including legal  fees arising out of your use of our Site or your violation of these Terms and Conditions.  

Applicable Law 

These Terms and Conditions are governed by the laws of the Country of England.  

Dispute Resolution 

Subject to any exceptions specified in these Terms and Conditions, if you and Salmon  Studios Ltd are unable to resolve any dispute through informal discussion, then you and  Salmon Studios Ltd agree to submit the issue first before a non-binding mediator and to an  arbitrator in the event that mediation fails. The decision of the arbitrator will be final and  binding. Any mediator or arbitrator must be a neutral party acceptable to both you and  Salmon Studios Ltd. The costs of any mediation or arbitration will be paid by the  unsuccessful party.  

Notwithstanding any other provision in these Terms and Conditions, you and Salmon  Studios Ltd agree that you both retain the right to bring an action in small claims court and  to bring an action for injunctive relief or intellectual property infringement.  

Severability 

If at any time any of the provisions set forth in these Terms and Conditions are found to be  inconsistent or invalid under applicable laws, those provisions will be deemed void and will 

be removed from these Terms and Conditions. All other provisions will not be affected by  the removal and the rest of these Terms and Conditions will still be considered valid.  

Changes 

These Terms and Conditions may be amended from time to time in order to maintain  compliance with the law and to reflect any changes to the way we operate our Site and the  way we expect users to behave on our Site. We will notify users by email of changes to  these Terms and Conditions or post a notice on our Site.  

Contact Details 

Please contact us if you have any questions or concerns. Our contact details are as follows: partnerships@salmonstudios.net 

You can also contact us through the Contact Us form available on our Site.  Effective Date: 2nd day of September, 2024 

Loading