<commit_before>var color = require('stylecow-color');

module.exports = function (stylecow) {

	stylecow.addTask({
		disable: {
			explorer: 9.0
		},
		Declaration: {
			background: fixer,
			"background-color": fixer
		}
	});
};

function fixer (declaration) {
	var fn = declaration.search({type: 'Function', name: ['rgba', 'hsla']});

	if (fn.length === 1) {
		var rgba = color.toRGBA(fn[0]);

		if (rgba[3] === 1) {
			fn[0].replaceWith('#' + color.RGBA_HEX(rgba));
		} else {
			var hex = '#' + Math.round(255 * rgba[3]).toString(16) + color.RGBA_HEX(rgba);

			declaration.ancestor({type: 'Rule'}).addOldMsFilter('progid:DXImageTransform.Microsoft.gradient(startColorStr="' + hex + '", endColorStr="' + hex + '")');
		}
	}
}<commit_msg>changes for the new api in stylecow<commit_after>var color = require('stylecow-color');

module.exports = function (stylecow) {

	stylecow.addTask({
		disable: {
			explorer: 9.0
		},
		Declaration: {
			background: fixer,
			"background-color": fixer
		}
	});
};

function fixer (declaration) {
	var fn = declaration.search({type: 'Function', name: ['rgba', 'hsla']});

	if (fn.length === 1) {
		var rgba = color.toRGBA(fn[0]);

		if (rgba[3] === 1) {
			fn[0].replaceWith('#' + color.RGBA_HEX(rgba));
		} else {
			var hex = '#' + Math.round(255 * rgba[3]).toString(16) + color.RGBA_HEX(rgba);

			declaration.parent({type: 'Rule'}).addOldMsFilter('progid:DXImageTransform.Microsoft.gradient(startColorStr="' + hex + '", endColorStr="' + hex + '")');
		}
	}
}
{'fraction_non_alphanumeric': 0.20372836218375498, 'fraction_numerical': 0.017310252996005325, 'mean_word_length': 4.200692041522491, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6751600', 'n_tokens_mistral': 638, 'n_tokens_neox': 565, 'n_words': 100}