--- title: slug: Web/SVG/Element/feColorMatrix tags: - Element - SVG - SVG Filter translation_of: Web/SVG/Element/feColorMatrix --- {{SVGRef}} La primitive de filtre SVG **``** change les couleurs d'un élément en fonction d'une matrice de transformation. Chaque pixel (représenté par un vecteur \[R,G,B,A]) est [multiplié par matrice](https://fr.wikipedia.org/wiki/Produit_matriciel) pour créer une nouvelle couleur: | R' | | a00 a01 a02 a03 a04 | | R | | G' | | a10 a11 a12 a13 a14 | | G | | B' | = | a20 a21 a22 a23 a24 | * | B | | A' | | a30 a31 a32 a33 a34 | | A | | 1 | | 0 0 0 0 1 | | 1 | ## Contexte d'utilisation {{svginfo}} ## Attributs ### Attributs globaux - [Attributs de base](/fr/docs/Web/SVG/Attribute#Attributs_de_base) - [Attributs de présentation](/fr/docs/Web/SVG/Attribute#Attributs_de_présentation) - [Attributs de primitive de filtre](/fr/docs/Web/SVG/Attribute#Attributs_de_primitives_de_filtre) - {{SVGAttr("class")}} - {{SVGAttr("style")}} ### Attributs spécifiques - {{SVGAttr("in")}} - {{SVGAttr("type")}} - {{SVGAttr("values")}} ## Interface DOM Cet élément implémente l'interface {{domxref("SVGFEColorMatrixElement")}}. ## Exemple ### SVG ```html Reference matrix saturate hueRotate luminanceToAlpha ``` ### Résultat {{EmbedLiveSample("Exemple", "100%", 700, "/files/4371/test.png")}} ## Spécifications | Spécification | Statut | Commentaire | | ---------------------------------------------------------------------------------------------------------------- | -------------------------------- | ------------------- | | {{SpecName('Filters 1.0', '#feColorMatrixElement', '<feColorMatrix>')}} | {{Spec2('Filters 1.0')}} | Aucun changement | | {{SpecName('SVG1.1', 'filters.html#feColorMatrixElement', '<feColorMatrix>')}} | {{Spec2('SVG1.1')}} | Définition initiale | ## Compatibilité des navigateurs {{Compat("svg.elements.feColorMatrix")}} ## Voir aussi - {{SVGElement("filter")}} - {{SVGElement("animate")}} - {{SVGElement("set")}} - {{SVGElement("feBlend")}} - {{SVGElement("feComponentTransfer")}} - {{SVGElement("feComposite")}} - {{SVGElement("feConvolveMatrix")}} - {{SVGElement("feDiffuseLighting")}} - {{SVGElement("feDisplacementMap")}} - {{SVGElement("feFlood")}} - {{SVGElement("feGaussianBlur")}} - {{SVGElement("feImage")}} - {{SVGElement("feMerge")}} - {{SVGElement("feMorphology")}} - {{SVGElement("feOffset")}} - {{SVGElement("feSpecularLighting")}} - {{SVGElement("feTile")}} - {{SVGElement("feTurbulence")}} - [Tutoriel SVG: Filtres](/fr/docs/Web/SVG/Tutoriel/filtres)