fr:code:core:color
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
fr:code:core:color [2012/03/21 15:44] – wismerheal | fr:code:core:color [2021/02/13 11:23] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== Color ====== | + | ====== Color [En cours de Traduction Wismerheal][WSL] |
- | This object represents a color. | + | Cet objet représente la couleur. |
===== Functions ===== | ===== Functions ===== | ||
==== Color ==== | ==== Color ==== | ||
- | Constructor function. | + | Fonction de construction. |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
var myObject = new Color(); | var myObject = new Color(); | ||
Ligne 23: | Ligne 23: | ||
=== Arguments === | === Arguments === | ||
- | - colorName - (string) | + | - colorName - (string) |
- | - otherColor - (Color) | + | - otherColor - (Color) |
- | - red - (integer) | + | - red - (integer) |
- | - green - (integer) | + | - green - (integer) |
- | - blue - (integer) | + | - blue - (integer) |
- | - alpha - (integer) alpha value (0-255) | + | - alpha - (integer) |
=== Exceptions === | === Exceptions === | ||
- | * (ColorNameError) incorrect | + | * (ColorNameError) |
- | * (ParameterTypeError) | + | * (ParameterTypeError) type de paramètre incorrect |
- | * (ParameterCountError) incorrect | + | * (ParameterCountError) |
=== Example === | === Example === | ||
- | Create a black Color. | + | Créer la Couleur noire. |
<code javascript> | <code javascript> | ||
var myObject = new Color(); | var myObject = new Color(); | ||
</ | </ | ||
- | Create a named color. See http:// | + | Créer une Couleur nommée. Voir http:// |
<code javascript> | <code javascript> | ||
var myObject = new Color(" | var myObject = new Color(" | ||
</ | </ | ||
- | Create a color from an hexadecimal | + | Créer une couleur à partir d'une valeur |
<code javascript> | <code javascript> | ||
var myObject = new Color("# | var myObject = new Color("# | ||
Ligne 51: | Ligne 51: | ||
var myObject = new Color("# | var myObject = new Color("# | ||
</ | </ | ||
- | Create a Color representing a copy of **otherColor**. | + | Créer une Couleur représentant une copie de **otherColor**.(autreCouleur) |
<code javascript> | <code javascript> | ||
var myObject = new Color(otherColor); | var myObject = new Color(otherColor); | ||
</ | </ | ||
- | Create a gray Color. | + | Créer la Couleur grise. |
<code javascript> | <code javascript> | ||
var myObject = new Color(50, 50, 50); | var myObject = new Color(50, 50, 50); | ||
</ | </ | ||
- | Create a half-transparent gray Color. | + | Créer une Couleur grise semi-transparente. |
<code javascript> | <code javascript> | ||
var myObject = new Color(50, 50, 50, 128); | var myObject = new Color(50, 50, 50, 128); | ||
</ | </ | ||
- | ===== Methods | + | ===== Méthodes |
==== clone ==== | ==== clone ==== | ||
- | Returns a copy of this Color. | + | Renvoie une copie de cette Couleur. |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.clone(); | myObject.clone(); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (Color) | + | * (Color) |
=== Example === | === Example === | ||
Ligne 80: | Ligne 80: | ||
</ | </ | ||
==== equals ==== | ==== equals ==== | ||
+ | Renvoie vrai si cette Couleur ou autres font références à la même couleur. | ||
Returns true if this Color and another are referencing the same color. | Returns true if this Color and another are referencing the same color. | ||
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.equals(other); | myObject.equals(other); | ||
Ligne 88: | Ligne 89: | ||
=== Arguments === | === Arguments === | ||
- | - other - (Color) | + | - other - (Color) |
=== Returns === | === Returns === | ||
- | * (bool) | + | * (bool) |
=== Example === | === Example === | ||
Ligne 99: | Ligne 100: | ||
</ | </ | ||
==== toString ==== | ==== toString ==== | ||
- | Returns a string representing this Color. | + | Renvoie une chaîne représentant la Couleur. |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.toString(); | myObject.toString(); | ||
</ | </ | ||
- | === Returns | + | === Renvoie=== |
- | * (string) a string representing this Color | + | * (chaîne) une chaîne représentant la Couleur |
=== Example === | === Example === | ||
Ligne 115: | Ligne 116: | ||
=== Notes === | === Notes === | ||
- | This method is automatically called when trying to convert a Color to a string. | + | Cette méthodes est automatiquement appelée quand on tente de convertir une Couleur en chaîne. |
==== setRed ==== | ==== setRed ==== | ||
- | Set the red component of this Color. | + | Définit le composant rouge de cette Couleur. |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.setRed(red); | myObject.setRed(red); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (Color) | + | * (Color) |
=== Example === | === Example === | ||
Ligne 132: | Ligne 134: | ||
</ | </ | ||
==== setGreen ==== | ==== setGreen ==== | ||
- | Set the green component of this Color. | + | Définit le composant verte cette Couleur. |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.setGreen(green); | myObject.setGreen(green); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (Color) | + | * (Color) |
=== Example === | === Example === | ||
Ligne 147: | Ligne 149: | ||
</ | </ | ||
==== setBlue ==== | ==== setBlue ==== | ||
- | Set the blue component of this Color. | + | Définit le composant bleu de cette Couleur. |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.setBlue(blue); | myObject.setBlue(blue); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (Color) | + | * (Color) |
=== Example === | === Example === | ||
Ligne 162: | Ligne 164: | ||
</ | </ | ||
==== setAlpha ==== | ==== setAlpha ==== | ||
- | Set the alpha component of this Color. | + | Définit le composant |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.setAlpha(alpha); | myObject.setAlpha(alpha); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (Color) | + | * (Color) |
=== Example === | === Example === | ||
Ligne 177: | Ligne 179: | ||
</ | </ | ||
==== setCmyk ==== | ==== setCmyk ==== | ||
- | Sets this Color to CMYK values. | + | Définit la valeur |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.setCmyk(cyan, | myObject.setCmyk(cyan, | ||
Ligne 187: | Ligne 189: | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (Color) | + | * (Color) |
=== Example === | === Example === | ||
Ligne 198: | Ligne 200: | ||
</ | </ | ||
==== setHsl ==== | ==== setHsl ==== | ||
- | Sets this Color to HSL values. | + | Définit la valeur |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.setHsl(hue, | myObject.setHsl(hue, | ||
Ligne 208: | Ligne 210: | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (Color) | + | * (Color) |
=== Example === | === Example === | ||
Ligne 219: | Ligne 221: | ||
</ | </ | ||
==== setHsv ==== | ==== setHsv ==== | ||
- | Sets this Color to HSV values. | + | Définit cette Couleur en valeur |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.setHsv(hue, | myObject.setHsv(hue, | ||
Ligne 229: | Ligne 231: | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (Color) | + | * (Color) |
=== Example === | === Example === | ||
Ligne 240: | Ligne 242: | ||
</ | </ | ||
==== setNamedColor ==== | ==== setNamedColor ==== | ||
- | Sets this Color to a named value. | + | Définit la Couleur en une valeur nommée. |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.setNamedColor(name); | myObject.setNamedColor(name); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (Color) | + | * (Color) |
=== Exceptions === | === Exceptions === | ||
- | * (ColorNameError) incorrect | + | * (ColorNameError) |
=== Example === | === Example === | ||
- | Set a named color. See http:// | + | Définit une couleur nommée. Voir http:// |
<code javascript> | <code javascript> | ||
myObject.setNamedColor(" | myObject.setNamedColor(" | ||
</ | </ | ||
- | Set a color from an hexadecimal | + | Définit une couleur à partir d'une valeur |
<code javascript> | <code javascript> | ||
myObject.setNamedColor("# | myObject.setNamedColor("# | ||
Ligne 266: | Ligne 268: | ||
</ | </ | ||
==== lighten ==== | ==== lighten ==== | ||
- | Lighten the color by a factor. | + | Facteur de luminance d'une couleur |
- | === Syntax | + | === Syntaxe |
- | Ligthen by 50%. | + | Luminance à 50%. |
<code javascript> | <code javascript> | ||
myObject.lighten(); | myObject.lighten(); | ||
Ligne 278: | Ligne 280: | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (Color) | + | * (Color) |
=== Example === | === Example === | ||
Ligne 289: | Ligne 291: | ||
</ | </ | ||
==== darken ==== | ==== darken ==== | ||
- | Darken the color by a factor. | + | Facteur d' |
- | === Syntax | + | === Syntaxe |
- | Darken by 50%. | + | Assombrir à 50%. |
<code javascript> | <code javascript> | ||
myObject.darken(); | myObject.darken(); | ||
Ligne 301: | Ligne 303: | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (Color) | + | * (Color) |
=== Example === | === Example === | ||
Ligne 312: | Ligne 314: | ||
</ | </ | ||
==== red ==== | ==== red ==== | ||
- | Returns the red component of this Color. | + | Renvoie le composant rouge de la Couleur. |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.red(); | myObject.red(); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (int) the red component value (0-255) | + | * (int) la valeur du composant rouge de la Couleur(0-255) |
=== Example === | === Example === | ||
Ligne 326: | Ligne 328: | ||
var myValue = myObject.red(); | var myValue = myObject.red(); | ||
</ | </ | ||
- | ==== blue ==== | + | |
- | Returns the blue component of this Color. | + | |
+ | |||
+ | ==== green ==== | ||
+ | Returns the green component of this Color. | ||
=== Syntax === | === Syntax === | ||
<code javascript> | <code javascript> | ||
- | myObject.blue(); | + | myObject.green(); |
</ | </ | ||
=== Returns === | === Returns === | ||
- | * (int) the blue component value (0-255) | + | * (int) the green component value (0-255) |
+ | |||
+ | === Example === | ||
+ | <code javascript> | ||
+ | var myValue = myObject.green(); | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ==== blue ==== | ||
+ | Renvoie le composant bleu de la Couleur. | ||
+ | |||
+ | === Syntaxe === | ||
+ | <code javascript> | ||
+ | myObject.blue(); | ||
+ | </ | ||
+ | |||
+ | === Renvoie === | ||
+ | * (int) la valeur du composant bleu de la Couleur(0-255) | ||
=== Example === | === Example === | ||
Ligne 342: | Ligne 365: | ||
</ | </ | ||
==== alpha ==== | ==== alpha ==== | ||
- | Returns the alpha component of this Color. | + | Renvoie le composant |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.alpha(); | myObject.alpha(); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (int) the alpha component value (0-255) | + | * (int) la valeur du composant |
=== Example === | === Example === | ||
Ligne 357: | Ligne 380: | ||
</ | </ | ||
==== cyan ==== | ==== cyan ==== | ||
- | Returns the cyan component of this Color. | + | Renvoie le composant |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.cyan(); | myObject.cyan(); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (int) the cyan component value (0-255) | + | * (int) la valeur du composant |
=== Example === | === Example === | ||
Ligne 372: | Ligne 395: | ||
</ | </ | ||
==== magenta ==== | ==== magenta ==== | ||
- | Returns the magenta | + | Renvoie le composant |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.magenta(); | myObject.magenta(); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (int) the magenta | + | * (int) la valeur du composant |
=== Example === | === Example === | ||
Ligne 387: | Ligne 410: | ||
</ | </ | ||
==== yellow ==== | ==== yellow ==== | ||
- | Returns the yellow component of this Color. | + | Renvoie le composant jaune de la Couleur. |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.yellow(); | myObject.yellow(); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (int) the yellow component value (0-255) | + | * (int) la valeur du composant jaune de la Couleur(0-255) |
=== Example === | === Example === | ||
Ligne 402: | Ligne 425: | ||
</ | </ | ||
==== black ==== | ==== black ==== | ||
- | Returns the black component of this Color. | + | Renvoie le composant noir de la Couleur. |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.black(); | myObject.black(); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (int) the black component value (0-255) | + | * (int) la valeur du composant noir de la Couleur(0-255) |
=== Example === | === Example === | ||
Ligne 417: | Ligne 440: | ||
</ | </ | ||
==== hue ==== | ==== hue ==== | ||
- | Returns the hue component of this Color. | + | Renvoie le composant teinte de la Couleur. |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.hue(); | myObject.hue(); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (int) the hue component value (0-255) | + | * (int)la valeur du composant teinte de la Couleur(0-255) |
=== Example === | === Example === | ||
Ligne 432: | Ligne 455: | ||
</ | </ | ||
==== saturation ==== | ==== saturation ==== | ||
- | Returns the saturation | + | Renvoie le composant |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.saturation(); | myObject.saturation(); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (int) the saturation | + | * (int) la valeur du composant |
=== Example === | === Example === | ||
Ligne 447: | Ligne 470: | ||
</ | </ | ||
==== lightness ==== | ==== lightness ==== | ||
- | Returns the lightness component of this Color. | + | Renvoie le composant luminance de la Couleur. |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.lightness(); | myObject.lightness(); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (int) the lightness component value (0-255) | + | * (int) la valeur du composant luminance de la Couleur(0-255) |
=== Example === | === Example === | ||
Ligne 462: | Ligne 485: | ||
</ | </ | ||
==== name ==== | ==== name ==== | ||
- | Returns the name of this Color in the format "# | + | Renvoie le nom de la Couleur au format "# |
- | === Syntax | + | === Syntaxe |
<code javascript> | <code javascript> | ||
myObject.name(); | myObject.name(); | ||
</ | </ | ||
- | === Returns | + | === Renvoie |
- | * (int) the name of this Color in the format "# | + | * (int) le nom de la Couleur au format "# |
=== Example === | === Example === | ||
Ligne 478: | Ligne 501: | ||
===== Attributes ===== | ===== Attributes ===== | ||
==== red ==== | ==== red ==== | ||
- | The red component of this Color. (integer) | + | Le composant rouge de cette Couleur. (entier) |
=== Example === | === Example === | ||
Ligne 486: | Ligne 509: | ||
</ | </ | ||
==== green ==== | ==== green ==== | ||
- | The green component of this Color. (integer) | + | Le composant vert de cette Couleur. (entier) |
=== Example === | === Example === | ||
Ligne 494: | Ligne 517: | ||
</ | </ | ||
==== blue ==== | ==== blue ==== | ||
- | The blue component of this Color. (integer) | + | Le composant bleu de cette Couleur. (entier) |
=== Example === | === Example === | ||
Ligne 502: | Ligne 525: | ||
</ | </ | ||
==== alpha ==== | ==== alpha ==== | ||
- | The alpha component of this Color. (integer) | + | Le composant |
=== Example === | === Example === |
fr/code/core/color.1332344683.txt.gz · Dernière modification : 2021/02/13 11:23 (modification externe)