This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function RGBAtoHSLA(r, g, b, a) { | |
var | |
min = Math.min(r, g, b), | |
max = Math.max(r, g, b), | |
diff = max - min, | |
hsla = [0, 0, (min + max) / 2, a]; | |
if (diff != 0) { | |
hsla[1] = hsla[2] < 0.5 ? diff / (max + min) : diff / (2 - max - min); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* ---------------------------------------------- | |
* HTML to JSON | |
* ---------------------------------------------- | |
* | |
* [Currently used in Wordpress to output HTML into a Google Maps InfoWindow correctly] | |
* |