Skip to content

Commit 5f2a755

Browse files
authored
Lint: use named color if possible (2) (mdn#40621)
1 parent ff4c8cf commit 5f2a755

File tree

55 files changed

+124
-124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+124
-124
lines changed

files/en-us/web/accessibility/aria/reference/attributes/aria-label/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The code below shows an example of how to use the `aria-label` attribute to prov
2727
xmlns="http://www.w3.org/2000/svg">
2828
<path
2929
d="m.967 14.217 5.8-5.906-5.765-5.89L3.094.26l5.783 5.888L14.66.26l2.092 2.162-5.766 5.889 5.801 5.906-2.092 2.162-5.818-5.924-5.818 5.924-2.092-2.162Z"
30-
fill="#000" />
30+
fill="black" />
3131
</svg>
3232
</button>
3333
```

files/en-us/web/accessibility/aria/reference/roles/button_role/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ button,
210210
button:active,
211211
button:focus,
212212
[role="button"][aria-pressed="true"] {
213-
border: 2px solid #000;
213+
border: 2px solid black;
214214
}
215215
```
216216

files/en-us/web/accessibility/aria/reference/roles/grid_role/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,13 @@ tbody td {
211211
}
212212

213213
tbody td {
214-
border: 1px solid #000;
214+
border: 1px solid black;
215215
text-align: right;
216216
color: #767676;
217217
}
218218

219219
tbody td[role="gridcell"] {
220-
color: #000;
220+
color: black;
221221
}
222222

223223
tbody td[role="gridcell"]:hover,

files/en-us/web/accessibility/guides/colors_and_luminance/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Where accessibility is concerned, however, standards and guidelines are currentl
130130
131131
### Querying color values
132132

133-
The {{domxref('Window.getComputedStyle()')}} method returns values using the RGB Decimal Reference scale or via `color(srgb...)`. For example, calling `Window.getComputedStyle()` on a `<div>` with `background-color: #ff0000` set on it returns the computed background color as `rgb(255 0 0)` — the RGB Decimal reference. However, when [using relative colors](/en-US/docs/Web/CSS/CSS_colors/Relative_colors) (for example `background-color: rgb(from blue 255 0 0)`), calling `Window.getComputedStyle()` returns the computed background color as `color(srgb 1 0 0)`. Being tied to computer hardware, `Window.getComputedStyle()` measures color in terms of RGB, not how the human eye perceives color.
133+
The {{domxref('Window.getComputedStyle()')}} method returns values using the RGB Decimal Reference scale or via `color(srgb...)`. For example, calling `Window.getComputedStyle()` on a `<div>` with `background-color: red` set on it returns the computed background color as `rgb(255, 0, 0)` — the RGB Decimal reference. However, when [using relative colors](/en-US/docs/Web/CSS/CSS_colors/Relative_colors) (for example `background-color: rgb(from blue 255 0 0)`), calling `Window.getComputedStyle()` returns the computed background color as `color(srgb 1 0 0)`. Being tied to computer hardware, `Window.getComputedStyle()` measures color in terms of RGB, not how the human eye perceives color.
134134

135135
### Red / green color blindness
136136

files/en-us/web/api/canvas_api/tutorial/applying_styles_and_colors/index.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function draw() {
136136
ctx.fillRect(0, 75, 75, 75);
137137
ctx.fillStyle = "#F30";
138138
ctx.fillRect(75, 75, 75, 75);
139-
ctx.fillStyle = "#FFF";
139+
ctx.fillStyle = "white";
140140

141141
// set transparency value
142142
ctx.globalAlpha = 0.2;
@@ -391,7 +391,7 @@ function draw() {
391391
ctx.strokeRect(-5, 50, 160, 50);
392392

393393
// Set line styles
394-
ctx.strokeStyle = "#000";
394+
ctx.strokeStyle = "black";
395395
ctx.lineWidth = 10;
396396

397397
// check input
@@ -517,13 +517,13 @@ function draw() {
517517
// Create gradients
518518
const linGrad = ctx.createLinearGradient(0, 0, 0, 150);
519519
linGrad.addColorStop(0, "#00ABEB");
520-
linGrad.addColorStop(0.5, "#fff");
520+
linGrad.addColorStop(0.5, "white");
521521
linGrad.addColorStop(0.5, "#26C000");
522-
linGrad.addColorStop(1, "#fff");
522+
linGrad.addColorStop(1, "white");
523523

524524
const linGrad2 = ctx.createLinearGradient(0, 50, 0, 95);
525-
linGrad2.addColorStop(0.5, "#000");
526-
linGrad2.addColorStop(1, "rgb(0 0 0 / 0%)");
525+
linGrad2.addColorStop(0.5, "black");
526+
linGrad2.addColorStop(1, "transparent");
527527

528528
// assign gradients to fill and stroke styles
529529
ctx.fillStyle = linGrad;
@@ -561,22 +561,22 @@ function draw() {
561561
const radGrad = ctx.createRadialGradient(45, 45, 10, 52, 50, 30);
562562
radGrad.addColorStop(0, "#A7D30C");
563563
radGrad.addColorStop(0.9, "#019F62");
564-
radGrad.addColorStop(1, "rgb(1 159 98 / 0%)");
564+
radGrad.addColorStop(1, "transparent");
565565

566566
const radGrad2 = ctx.createRadialGradient(105, 105, 20, 112, 120, 50);
567567
radGrad2.addColorStop(0, "#FF5F98");
568568
radGrad2.addColorStop(0.75, "#FF0188");
569-
radGrad2.addColorStop(1, "rgb(255 1 136 / 0%)");
569+
radGrad2.addColorStop(1, "transparent");
570570

571571
const radGrad3 = ctx.createRadialGradient(95, 15, 15, 102, 20, 40);
572572
radGrad3.addColorStop(0, "#00C9FF");
573573
radGrad3.addColorStop(0.8, "#00B5E2");
574-
radGrad3.addColorStop(1, "rgb(0 201 255 / 0%)");
574+
radGrad3.addColorStop(1, "transparent");
575575

576576
const radGrad4 = ctx.createRadialGradient(0, 150, 50, 0, 140, 90);
577577
radGrad4.addColorStop(0, "#F4F201");
578578
radGrad4.addColorStop(0.8, "#E4C700");
579-
radGrad4.addColorStop(1, "rgb(228 199 0 / 0%)");
579+
radGrad4.addColorStop(1, "transparent");
580580

581581
// draw shapes
582582
ctx.fillStyle = radGrad4;
@@ -615,7 +615,7 @@ function draw() {
615615
// Create gradients
616616
const conicGrad1 = ctx.createConicGradient(2, 62, 75);
617617
conicGrad1.addColorStop(0, "#A7D30C");
618-
conicGrad1.addColorStop(1, "#fff");
618+
conicGrad1.addColorStop(1, "white");
619619

620620
const conicGrad2 = ctx.createConicGradient(0, 187, 75);
621621
// we multiply our values by Math.PI/180 to convert degrees to radians

files/en-us/web/api/canvas_api/tutorial/basic_animations/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ function clock() {
218218
ctx.beginPath();
219219
ctx.arc(95, 0, 10, 0, Math.PI * 2, true);
220220
ctx.stroke();
221-
ctx.fillStyle = "rgb(0 0 0 / 0%)";
221+
ctx.fillStyle = "transparent";
222222
ctx.arc(0, 0, 3, 0, Math.PI * 2, true);
223223
ctx.fill();
224224
ctx.restore();

files/en-us/web/api/canvas_api/tutorial/compositing/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function draw() {
6161
function generateStars(ctx) {
6262
for (let j = 1; j < 50; j++) {
6363
ctx.save();
64-
ctx.fillStyle = "#fff";
64+
ctx.fillStyle = "white";
6565
ctx.translate(
6666
75 - Math.floor(Math.random() * 150),
6767
75 - Math.floor(Math.random() * 150),
@@ -147,7 +147,7 @@ function draw() {
147147
function generateStars(ctx) {
148148
for (let j = 1; j < 50; j++) {
149149
ctx.save();
150-
ctx.fillStyle = "#fff";
150+
ctx.fillStyle = "white";
151151
ctx.translate(
152152
75 - Math.floor(Math.random() * 150),
153153
75 - Math.floor(Math.random() * 150),

files/en-us/web/api/canvas_api/tutorial/pixel_manipulation_with_canvas/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ To create a new, blank `ImageData` object, you should use the {{domxref("CanvasR
6060
const myImageData = ctx.createImageData(width, height);
6161
```
6262

63-
This creates a new `ImageData` object with the specified dimensions. All pixels are preset to transparent black (all zeroes, i.e., rgb(0 0 0 / 0%)).
63+
This creates a new `ImageData` object with the specified dimensions. All pixels are preset to transparent.
6464

6565
You can also create a new `ImageData` object with the same dimensions as the object specified by `anotherImageData`. The new object's pixels are all preset to transparent black. **This does not copy the image data!**
6666

files/en-us/web/api/canvas_api/tutorial/transformations/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function draw() {
5656
ctx.fillRect(15, 15, 120, 120); // Draw a Blue rectangle with new settings
5757
ctx.save(); // Save the current state
5858

59-
ctx.fillStyle = "#FFF"; // Make changes to saved settings
59+
ctx.fillStyle = "white"; // Make changes to saved settings
6060
ctx.globalAlpha = 0.5;
6161
ctx.fillRect(30, 30, 90, 90); // Draw a 50%-White rectangle with newest settings
6262

files/en-us/web/api/canvasrenderingcontext2d/arcto/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,11 @@ label {
255255
margin: 10px;
256256
}
257257
.input {
258-
color: #00f;
258+
color: blue;
259259
text-decoration: underline;
260260
}
261261
#canvas {
262-
border: 1px solid #000;
262+
border: 1px solid black;
263263
}
264264
```
265265

@@ -729,8 +729,8 @@ function moveActivePointAndUpdate(pointCursor) {
729729

730730
function drawCanvas() {
731731
const rPoint = 4;
732-
const colorConstruction = "#080";
733-
const colorDraggable = "#00F";
732+
const colorConstruction = "green";
733+
const colorDraggable = "blue";
734734
const [P0, P1, P2] = state.controlPoints;
735735

736736
ctx.font = "italic 14pt sans-serif";
@@ -765,7 +765,7 @@ function drawCanvas() {
765765
ctx.arc(state.C.x, state.C.y, state.radius, 0, 2 * Math.PI);
766766
ctx.stroke();
767767

768-
ctx.fillStyle = "#000";
768+
ctx.fillStyle = "black";
769769
ctx.fillText("C", state.C.x, state.C.y - 15);
770770
ctx.fillText("T\u2081", state.T1.x, state.T1.y - 15);
771771
ctx.fillText("T\u2082", state.T2.x, state.T2.y - 15);
@@ -792,7 +792,7 @@ function drawCanvas() {
792792
ctx.fillStyle = colorDraggable;
793793
ctx.fill();
794794
});
795-
ctx.fillStyle = "#000";
795+
ctx.fillStyle = "black";
796796
ctx.fillText("P\u2080", P0.x, P0.y - 15);
797797
ctx.fillText("P\u2081", P1.x, P1.y - 15);
798798
ctx.fillText("P\u2082", P2.x, P2.y - 15);
@@ -803,7 +803,7 @@ function drawCanvas() {
803803
ctx.moveTo(P0.x, P0.y);
804804
ctx.setLineDash([]);
805805
ctx.arcTo(P1.x, P1.y, P2.x, P2.y, state.radius);
806-
ctx.strokeStyle = "#000";
806+
ctx.strokeStyle = "black";
807807
ctx.stroke();
808808
} /* end of function drawCanvas */
809809

0 commit comments

Comments
 (0)