Skip to content

Instantly share code, notes, and snippets.

@lkallioniemi
lkallioniemi / deuteranopia
Created August 26, 2016 06:38
Colorblind filters
javascript:var%20svg=document.createElementNS('http://www.w3.org/2000/svg','svg');var%20filter=document.createElementNS('http://www.w3.org/2000/svg',%20'filter');filter.setAttribute('id',%20'f2');var%20colorMatrix=document.createElementNS('http://www.w3.org/2000/svg',%20'feColorMatrix');colorMatrix.setAttribute('values','0.4251%200.6934%20-0.1147%200%200%200.3417%200.5882%200.0692%200%200%20-0.0105%200.0234%200.9870%200%200%200%200%200%201%200');filter.appendChild(colorMatrix);svg.appendChild(filter);document.body.appendChild(svg);document.body.setAttribute('style','-webkit-filter:url(%23f2);-moz-filter:url(%23f2);-ms-filter:%20url(%23f2);-o-filter:%20url(%23f2);filter:%20url(%23f2)');