Thay đổi màu văn bản python

Kiểu dữ liệu CSS

 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

0 đại diện cho một màu. Một
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

0 cũng có thể bao gồm một giá trị độ trong suốt của kênh alpha, cho biết màu nên phù hợp với nền của nó như thế nào

Một

 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

0 có thể được định nghĩa theo bất kỳ cách nào sau đây

  • Sử dụng từ khóa [chẳng hạn như
     = 
    |
    currentcolor |


    =
    |
    |
    |
    transparent

    =
    |
    |
    |
    |
    |
    |
    |
    |
    |


    =
    rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
    rgb[ [ | none ]{3} [ / [ | none ] ]? ]

    =
    hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

    =
    hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

    =
    lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

    =
    lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

    =
    oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

    =
    oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

    =
    color[ [ / [ | none ] ]? ]

    =
    |


    =
    |


    =
    |


    =
    [ | | none ]{3}

    =
    [ | | none ]{3}

    =
    srgb |
    srgb-linear |
    display-p3 |
    a98-rgb |
    prophoto-rgb |
    rec2020

    =
    xyz |
    xyz-d50 |
    xyz-d65

    3 hoặc
     = 
    |
    currentcolor |


    =
    |
    |
    |
    transparent

    =
    |
    |
    |
    |
    |
    |
    |
    |
    |


    =
    rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
    rgb[ [ | none ]{3} [ / [ | none ] ]? ]

    =
    hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

    =
    hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

    =
    lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

    =
    lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

    =
    oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

    =
    oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

    =
    color[ [ / [ | none ] ]? ]

    =
    |


    =
    |


    =
    |


    =
    [ | | none ]{3}

    =
    [ | | none ]{3}

    =
    srgb |
    srgb-linear |
    display-p3 |
    a98-rgb |
    prophoto-rgb |
    rec2020

    =
    xyz |
    xyz-d50 |
    xyz-d65

    4]. Tất cả các từ khóa hiện có chỉ định một màu trong không gian màu sRGB
  • Sử dụng hệ thống [thông qua ký hiệu chức năng #-thập lục phân hoặc
     = 
    |
    currentcolor |


    =
    |
    |
    |
    transparent

    =
    |
    |
    |
    |
    |
    |
    |
    |
    |


    =
    rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
    rgb[ [ | none ]{3} [ / [ | none ] ]? ]

    =
    hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

    =
    hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

    =
    lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

    =
    lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

    =
    oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

    =
    oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

    =
    color[ [ / [ | none ] ]? ]

    =
    |


    =
    |


    =
    |


    =
    [ | | none ]{3}

    =
    [ | | none ]{3}

    =
    srgb |
    srgb-linear |
    display-p3 |
    a98-rgb |
    prophoto-rgb |
    rec2020

    =
    xyz |
    xyz-d50 |
    xyz-d65

    5]. Chúng luôn chỉ định một màu trong không gian màu sRGB
  • Sử dụng hệ tọa độ trụ HSL [thông qua ký hiệu chức năng
     = 
    |
    currentcolor |


    =
    |
    |
    |
    transparent

    =
    |
    |
    |
    |
    |
    |
    |
    |
    |


    =
    rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
    rgb[ [ | none ]{3} [ / [ | none ] ]? ]

    =
    hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

    =
    hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

    =
    lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

    =
    lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

    =
    oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

    =
    oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

    =
    color[ [ / [ | none ] ]? ]

    =
    |


    =
    |


    =
    |


    =
    [ | | none ]{3}

    =
    [ | | none ]{3}

    =
    srgb |
    srgb-linear |
    display-p3 |
    a98-rgb |
    prophoto-rgb |
    rec2020

    =
    xyz |
    xyz-d50 |
    xyz-d65

    6]. Chúng luôn chỉ định một màu trong không gian màu sRGB
  • Sử dụng hệ tọa độ trụ HWB [thông qua ký hiệu chức năng
     = 
    |
    currentcolor |


    =
    |
    |
    |
    transparent

    =
    |
    |
    |
    |
    |
    |
    |
    |
    |


    =
    rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
    rgb[ [ | none ]{3} [ / [ | none ] ]? ]

    =
    hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

    =
    hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

    =
    lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

    =
    lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

    =
    oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

    =
    oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

    =
    color[ [ / [ | none ] ]? ]

    =
    |


    =
    |


    =
    |


    =
    [ | | none ]{3}

    =
    [ | | none ]{3}

    =
    srgb |
    srgb-linear |
    display-p3 |
    a98-rgb |
    prophoto-rgb |
    rec2020

    =
    xyz |
    xyz-d50 |
    xyz-d65

    7]. Chúng luôn chỉ định một màu trong không gian màu sRGB
  • Sử dụng , thông qua ký hiệu chức năng
     = 
    |
    currentcolor |


    =
    |
    |
    |
    transparent

    =
    |
    |
    |
    |
    |
    |
    |
    |
    |


    =
    rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
    rgb[ [ | none ]{3} [ / [ | none ] ]? ]

    =
    hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

    =
    hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

    =
    lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

    =
    lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

    =
    oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

    =
    oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

    =
    color[ [ / [ | none ] ]? ]

    =
    |


    =
    |


    =
    |


    =
    [ | | none ]{3}

    =
    [ | | none ]{3}

    =
    srgb |
    srgb-linear |
    display-p3 |
    a98-rgb |
    prophoto-rgb |
    rec2020

    =
    xyz |
    xyz-d50 |
    xyz-d65

    8. Điều này có thể chỉ định bất kỳ màu nào có thể nhìn thấy
  • Sử dụng hệ tọa độ Lab, thông qua ký hiệu chức năng
     = 
    |
    currentcolor |


    =
    |
    |
    |
    transparent

    =
    |
    |
    |
    |
    |
    |
    |
    |
    |


    =
    rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
    rgb[ [ | none ]{3} [ / [ | none ] ]? ]

    =
    hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

    =
    hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

    =
    lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

    =
    lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

    =
    oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

    =
    oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

    =
    color[ [ / [ | none ] ]? ]

    =
    |


    =
    |


    =
    |


    =
    [ | | none ]{3}

    =
    [ | | none ]{3}

    =
    srgb |
    srgb-linear |
    display-p3 |
    a98-rgb |
    prophoto-rgb |
    rec2020

    =
    xyz |
    xyz-d50 |
    xyz-d65

    9. Điều này có thể chỉ định bất kỳ màu nào có thể nhìn thấy
  • Sử dụng ký hiệu chức năng
    
    
    Enter a valid color value:
    
    
    0, để chỉ định một màu trong nhiều không gian màu được xác định trước hoặc tùy chỉnh

Ghi chú. Bài viết này mô tả chi tiết về kiểu dữ liệu

 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

0. Để tìm hiểu thêm về cách sử dụng màu trong HTML, hãy xem Áp dụng màu cho các thành phần HTML bằng CSS

Loại dữ liệu

 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

0 được chỉ định bằng một trong các tùy chọn được liệt kê bên dưới

Ghi chú. Mặc dù các giá trị

 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

0 được xác định chính xác, hình thức thực tế của chúng có thể khác nhau [đôi khi đáng kể] từ thiết bị này sang thiết bị khác. Điều này là do hầu hết các thiết bị không được hiệu chỉnh và một số trình duyệt không hỗ trợ cấu hình màu của thiết bị đầu ra

Các màu được đặt tên là các mã định danh phân biệt chữ hoa chữ thường đại diện cho một màu cụ thể, chẳng hạn như



Enter a valid color value:

4,
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

3,


Enter a valid color value:

6 hoặc


Enter a valid color value:

7. Mặc dù những cái tên ít nhiều mô tả màu sắc tương ứng của chúng, nhưng về cơ bản chúng là nhân tạo, không có lý do chính đáng đằng sau những cái tên được sử dụng

Danh sách đầy đủ các từ khóa như vậy có sẵn ở đây

Từ khóa



Enter a valid color value:

8 đại diện cho giá trị của thuộc tính


Enter a valid color value:

9 của một phần tử. Điều này cho phép bạn sử dụng giá trị


Enter a valid color value:

9 trên các thuộc tính không nhận được giá trị này theo mặc định

Nếu



Enter a valid color value:

8 được sử dụng làm giá trị của tài sản


Enter a valid color value:

9, thì thay vào đó, nó sẽ lấy giá trị của nó từ giá trị kế thừa của tài sản


Enter a valid color value:

9


  The color of this text is blue.
  
  This block is surrounded by a blue border.

Mô hình màu RGB xác định một màu nhất định trong không gian màu sRGB theo các thành phần đỏ, lục và lam của nó. Một thành phần alpha tùy chọn thể hiện độ trong suốt của màu

Màu RGB có thể được thể hiện thông qua cả ký hiệu thập lục phân [có tiền tố là

div {
  width: 100%;
  height: 200px;
}
4] và ký hiệu chức năng [
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

5,
div {
  width: 100%;
  height: 200px;
}
6]

ký hiệu thập lục phân.
div {
  width: 100%;
  height: 200px;
}
7 hoặc______25_______8

div {
  width: 100%;
  height: 200px;
}
9 [đỏ],
const inputElem = document.querySelector["input"];
const divElem = document.querySelector["div"];

function validTextColor[stringToTest] {
  if [stringToTest === ""] {
    return false;
  }
  if [stringToTest === "inherit"] {
    return false;
  }
  if [stringToTest === "transparent"] {
    return false;
  }

  const image = document.createElement["img"];
  image.style.color = "rgb[0, 0, 0]";
  image.style.color = stringToTest;
  if [image.style.color !== "rgb[0, 0, 0]"] {
    return true;
  }
  image.style.color = "rgb[255, 255, 255]";
  image.style.color = stringToTest;
  return image.style.color !== "rgb[255, 255, 255]";
}

inputElem.addEventListener["change", [] => {
  if [validTextColor[inputElem.value]] {
    divElem.style.backgroundColor = inputElem.value;
    divElem.textContent = "";
  } else {
    divElem.style.backgroundColor = "white";
    divElem.textContent = "Invalid color value";
  }
}];
0 [xanh lục],
const inputElem = document.querySelector["input"];
const divElem = document.querySelector["div"];

function validTextColor[stringToTest] {
  if [stringToTest === ""] {
    return false;
  }
  if [stringToTest === "inherit"] {
    return false;
  }
  if [stringToTest === "transparent"] {
    return false;
  }

  const image = document.createElement["img"];
  image.style.color = "rgb[0, 0, 0]";
  image.style.color = stringToTest;
  if [image.style.color !== "rgb[0, 0, 0]"] {
    return true;
  }
  image.style.color = "rgb[255, 255, 255]";
  image.style.color = stringToTest;
  return image.style.color !== "rgb[255, 255, 255]";
}

inputElem.addEventListener["change", [] => {
  if [validTextColor[inputElem.value]] {
    divElem.style.backgroundColor = inputElem.value;
    divElem.textContent = "";
  } else {
    divElem.style.backgroundColor = "white";
    divElem.textContent = "Invalid color value";
  }
}];
1 [xanh dương] và
const inputElem = document.querySelector["input"];
const divElem = document.querySelector["div"];

function validTextColor[stringToTest] {
  if [stringToTest === ""] {
    return false;
  }
  if [stringToTest === "inherit"] {
    return false;
  }
  if [stringToTest === "transparent"] {
    return false;
  }

  const image = document.createElement["img"];
  image.style.color = "rgb[0, 0, 0]";
  image.style.color = stringToTest;
  if [image.style.color !== "rgb[0, 0, 0]"] {
    return true;
  }
  image.style.color = "rgb[255, 255, 255]";
  image.style.color = stringToTest;
  return image.style.color !== "rgb[255, 255, 255]";
}

inputElem.addEventListener["change", [] => {
  if [validTextColor[inputElem.value]] {
    divElem.style.backgroundColor = inputElem.value;
    divElem.textContent = "";
  } else {
    divElem.style.backgroundColor = "white";
    divElem.textContent = "Invalid color value";
  }
}];
2 [alpha] là các ký tự thập lục phân [0–9, A–F].
const inputElem = document.querySelector["input"];
const divElem = document.querySelector["div"];

function validTextColor[stringToTest] {
  if [stringToTest === ""] {
    return false;
  }
  if [stringToTest === "inherit"] {
    return false;
  }
  if [stringToTest === "transparent"] {
    return false;
  }

  const image = document.createElement["img"];
  image.style.color = "rgb[0, 0, 0]";
  image.style.color = stringToTest;
  if [image.style.color !== "rgb[0, 0, 0]"] {
    return true;
  }
  image.style.color = "rgb[255, 255, 255]";
  image.style.color = stringToTest;
  return image.style.color !== "rgb[255, 255, 255]";
}

inputElem.addEventListener["change", [] => {
  if [validTextColor[inputElem.value]] {
    divElem.style.backgroundColor = inputElem.value;
    divElem.textContent = "";
  } else {
    divElem.style.backgroundColor = "white";
    divElem.textContent = "Invalid color value";
  }
}];
2 là tùy chọn. Ví dụ:
const inputElem = document.querySelector["input"];
const divElem = document.querySelector["div"];

function validTextColor[stringToTest] {
  if [stringToTest === ""] {
    return false;
  }
  if [stringToTest === "inherit"] {
    return false;
  }
  if [stringToTest === "transparent"] {
    return false;
  }

  const image = document.createElement["img"];
  image.style.color = "rgb[0, 0, 0]";
  image.style.color = stringToTest;
  if [image.style.color !== "rgb[0, 0, 0]"] {
    return true;
  }
  image.style.color = "rgb[255, 255, 255]";
  image.style.color = stringToTest;
  return image.style.color !== "rgb[255, 255, 255]";
}

inputElem.addEventListener["change", [] => {
  if [validTextColor[inputElem.value]] {
    divElem.style.backgroundColor = inputElem.value;
    divElem.textContent = "";
  } else {
    divElem.style.backgroundColor = "white";
    divElem.textContent = "Invalid color value";
  }
}];
4 tương đương với
const inputElem = document.querySelector["input"];
const divElem = document.querySelector["div"];

function validTextColor[stringToTest] {
  if [stringToTest === ""] {
    return false;
  }
  if [stringToTest === "inherit"] {
    return false;
  }
  if [stringToTest === "transparent"] {
    return false;
  }

  const image = document.createElement["img"];
  image.style.color = "rgb[0, 0, 0]";
  image.style.color = stringToTest;
  if [image.style.color !== "rgb[0, 0, 0]"] {
    return true;
  }
  image.style.color = "rgb[255, 255, 255]";
  image.style.color = stringToTest;
  return image.style.color !== "rgb[255, 255, 255]";
}

inputElem.addEventListener["change", [] => {
  if [validTextColor[inputElem.value]] {
    divElem.style.backgroundColor = inputElem.value;
    divElem.textContent = "";
  } else {
    divElem.style.backgroundColor = "white";
    divElem.textContent = "Invalid color value";
  }
}];
5. Ký hiệu ba chữ số [
const inputElem = document.querySelector["input"];
const divElem = document.querySelector["div"];

function validTextColor[stringToTest] {
  if [stringToTest === ""] {
    return false;
  }
  if [stringToTest === "inherit"] {
    return false;
  }
  if [stringToTest === "transparent"] {
    return false;
  }

  const image = document.createElement["img"];
  image.style.color = "rgb[0, 0, 0]";
  image.style.color = stringToTest;
  if [image.style.color !== "rgb[0, 0, 0]"] {
    return true;
  }
  image.style.color = "rgb[255, 255, 255]";
  image.style.color = stringToTest;
  return image.style.color !== "rgb[255, 255, 255]";
}

inputElem.addEventListener["change", [] => {
  if [validTextColor[inputElem.value]] {
    divElem.style.backgroundColor = inputElem.value;
    divElem.textContent = "";
  } else {
    divElem.style.backgroundColor = "white";
    divElem.textContent = "Invalid color value";
  }
}];
6] là phiên bản ngắn hơn của dạng sáu chữ số [
const inputElem = document.querySelector["input"];
const divElem = document.querySelector["div"];

function validTextColor[stringToTest] {
  if [stringToTest === ""] {
    return false;
  }
  if [stringToTest === "inherit"] {
    return false;
  }
  if [stringToTest === "transparent"] {
    return false;
  }

  const image = document.createElement["img"];
  image.style.color = "rgb[0, 0, 0]";
  image.style.color = stringToTest;
  if [image.style.color !== "rgb[0, 0, 0]"] {
    return true;
  }
  image.style.color = "rgb[255, 255, 255]";
  image.style.color = stringToTest;
  return image.style.color !== "rgb[255, 255, 255]";
}

inputElem.addEventListener["change", [] => {
  if [validTextColor[inputElem.value]] {
    divElem.style.backgroundColor = inputElem.value;
    divElem.textContent = "";
  } else {
    divElem.style.backgroundColor = "white";
    divElem.textContent = "Invalid color value";
  }
}];
7]. Ví dụ:
const inputElem = document.querySelector["input"];
const divElem = document.querySelector["div"];

function validTextColor[stringToTest] {
  if [stringToTest === ""] {
    return false;
  }
  if [stringToTest === "inherit"] {
    return false;
  }
  if [stringToTest === "transparent"] {
    return false;
  }

  const image = document.createElement["img"];
  image.style.color = "rgb[0, 0, 0]";
  image.style.color = stringToTest;
  if [image.style.color !== "rgb[0, 0, 0]"] {
    return true;
  }
  image.style.color = "rgb[255, 255, 255]";
  image.style.color = stringToTest;
  return image.style.color !== "rgb[255, 255, 255]";
}

inputElem.addEventListener["change", [] => {
  if [validTextColor[inputElem.value]] {
    divElem.style.backgroundColor = inputElem.value;
    divElem.textContent = "";
  } else {
    divElem.style.backgroundColor = "white";
    divElem.textContent = "Invalid color value";
  }
}];
8 có cùng màu với
const inputElem = document.querySelector["input"];
const divElem = document.querySelector["div"];

function validTextColor[stringToTest] {
  if [stringToTest === ""] {
    return false;
  }
  if [stringToTest === "inherit"] {
    return false;
  }
  if [stringToTest === "transparent"] {
    return false;
  }

  const image = document.createElement["img"];
  image.style.color = "rgb[0, 0, 0]";
  image.style.color = stringToTest;
  if [image.style.color !== "rgb[0, 0, 0]"] {
    return true;
  }
  image.style.color = "rgb[255, 255, 255]";
  image.style.color = stringToTest;
  return image.style.color !== "rgb[255, 255, 255]";
}

inputElem.addEventListener["change", [] => {
  if [validTextColor[inputElem.value]] {
    divElem.style.backgroundColor = inputElem.value;
    divElem.textContent = "";
  } else {
    divElem.style.backgroundColor = "white";
    divElem.textContent = "Invalid color value";
  }
}];
9. Tương tự như vậy, ký hiệu RGB gồm bốn chữ số [
/* These syntax variations all specify the same color: a fully opaque hot pink. */

/* Hexadecimal syntax */
#f09
#F09
#ff0099
#FF0099

/* Functional syntax */
rgb[255,0,153]
rgb[255, 0, 153]
rgb[255, 0, 153.0]
rgb[100%,0%,60%]
rgb[100%, 0%, 60%]
rgb[100%, 0, 60%] /* ERROR! Don't mix numbers and percentages. */
rgb[255 0 153]

/* Hexadecimal syntax with alpha value */
#f09f
#F09F
#ff0099ff
#FF0099FF

/* Functional syntax with alpha value */
rgb[255, 0, 153, 1]
rgb[255, 0, 153, .5]
rgb[255, 0, 153, 0.5]
rgb[255, 0, 153, 100%]

/* Whitespace syntax */
rgb[255 0 153 / 1]
rgb[255 0 153 / 100%]

/* Functional syntax with floats value */
rgb[255, 0, 153.6, 1]
rgb[2.55e2, 0e0, 1.53e2, 1e2%]
0] là phiên bản ngắn hơn của dạng tám chữ số [
/* These syntax variations all specify the same color: a fully opaque hot pink. */

/* Hexadecimal syntax */
#f09
#F09
#ff0099
#FF0099

/* Functional syntax */
rgb[255,0,153]
rgb[255, 0, 153]
rgb[255, 0, 153.0]
rgb[100%,0%,60%]
rgb[100%, 0%, 60%]
rgb[100%, 0, 60%] /* ERROR! Don't mix numbers and percentages. */
rgb[255 0 153]

/* Hexadecimal syntax with alpha value */
#f09f
#F09F
#ff0099ff
#FF0099FF

/* Functional syntax with alpha value */
rgb[255, 0, 153, 1]
rgb[255, 0, 153, .5]
rgb[255, 0, 153, 0.5]
rgb[255, 0, 153, 100%]

/* Whitespace syntax */
rgb[255 0 153 / 1]
rgb[255 0 153 / 100%]

/* Functional syntax with floats value */
rgb[255, 0, 153.6, 1]
rgb[2.55e2, 0e0, 1.53e2, 1e2%]
1]. Ví dụ:
/* These syntax variations all specify the same color: a fully opaque hot pink. */

/* Hexadecimal syntax */
#f09
#F09
#ff0099
#FF0099

/* Functional syntax */
rgb[255,0,153]
rgb[255, 0, 153]
rgb[255, 0, 153.0]
rgb[100%,0%,60%]
rgb[100%, 0%, 60%]
rgb[100%, 0, 60%] /* ERROR! Don't mix numbers and percentages. */
rgb[255 0 153]

/* Hexadecimal syntax with alpha value */
#f09f
#F09F
#ff0099ff
#FF0099FF

/* Functional syntax with alpha value */
rgb[255, 0, 153, 1]
rgb[255, 0, 153, .5]
rgb[255, 0, 153, 0.5]
rgb[255, 0, 153, 100%]

/* Whitespace syntax */
rgb[255 0 153 / 1]
rgb[255 0 153 / 100%]

/* Functional syntax with floats value */
rgb[255, 0, 153.6, 1]
rgb[2.55e2, 0e0, 1.53e2, 1e2%]
2 có cùng màu với
/* These syntax variations all specify the same color: a fully opaque hot pink. */

/* Hexadecimal syntax */
#f09
#F09
#ff0099
#FF0099

/* Functional syntax */
rgb[255,0,153]
rgb[255, 0, 153]
rgb[255, 0, 153.0]
rgb[100%,0%,60%]
rgb[100%, 0%, 60%]
rgb[100%, 0, 60%] /* ERROR! Don't mix numbers and percentages. */
rgb[255 0 153]

/* Hexadecimal syntax with alpha value */
#f09f
#F09F
#ff0099ff
#FF0099FF

/* Functional syntax with alpha value */
rgb[255, 0, 153, 1]
rgb[255, 0, 153, .5]
rgb[255, 0, 153, 0.5]
rgb[255, 0, 153, 100%]

/* Whitespace syntax */
rgb[255 0 153 / 1]
rgb[255 0 153 / 100%]

/* Functional syntax with floats value */
rgb[255, 0, 153.6, 1]
rgb[2.55e2, 0e0, 1.53e2, 1e2%]
3

 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

5 hoặc
div {
  width: 100%;
  height: 200px;
}
6.
/* These syntax variations all specify the same color: a fully opaque hot pink. */

/* Hexadecimal syntax */
#f09
#F09
#ff0099
#FF0099

/* Functional syntax */
rgb[255,0,153]
rgb[255, 0, 153]
rgb[255, 0, 153.0]
rgb[100%,0%,60%]
rgb[100%, 0%, 60%]
rgb[100%, 0, 60%] /* ERROR! Don't mix numbers and percentages. */
rgb[255 0 153]

/* Hexadecimal syntax with alpha value */
#f09f
#F09F
#ff0099ff
#FF0099FF

/* Functional syntax with alpha value */
rgb[255, 0, 153, 1]
rgb[255, 0, 153, .5]
rgb[255, 0, 153, 0.5]
rgb[255, 0, 153, 100%]

/* Whitespace syntax */
rgb[255 0 153 / 1]
rgb[255 0 153 / 100%]

/* Functional syntax with floats value */
rgb[255, 0, 153.6, 1]
rgb[2.55e2, 0e0, 1.53e2, 1e2%]
6 hoặc
/* These syntax variations all specify the same color: a fully opaque hot pink. */

/* Hexadecimal syntax */
#f09
#F09
#ff0099
#FF0099

/* Functional syntax */
rgb[255,0,153]
rgb[255, 0, 153]
rgb[255, 0, 153.0]
rgb[100%,0%,60%]
rgb[100%, 0%, 60%]
rgb[100%, 0, 60%] /* ERROR! Don't mix numbers and percentages. */
rgb[255 0 153]

/* Hexadecimal syntax with alpha value */
#f09f
#F09F
#ff0099ff
#FF0099FF

/* Functional syntax with alpha value */
rgb[255, 0, 153, 1]
rgb[255, 0, 153, .5]
rgb[255, 0, 153, 0.5]
rgb[255, 0, 153, 100%]

/* Whitespace syntax */
rgb[255 0 153 / 1]
rgb[255 0 153 / 100%]

/* Functional syntax with floats value */
rgb[255, 0, 153.6, 1]
rgb[2.55e2, 0e0, 1.53e2, 1e2%]
7

div {
  width: 100%;
  height: 200px;
}
9 [đỏ],
const inputElem = document.querySelector["input"];
const divElem = document.querySelector["div"];

function validTextColor[stringToTest] {
  if [stringToTest === ""] {
    return false;
  }
  if [stringToTest === "inherit"] {
    return false;
  }
  if [stringToTest === "transparent"] {
    return false;
  }

  const image = document.createElement["img"];
  image.style.color = "rgb[0, 0, 0]";
  image.style.color = stringToTest;
  if [image.style.color !== "rgb[0, 0, 0]"] {
    return true;
  }
  image.style.color = "rgb[255, 255, 255]";
  image.style.color = stringToTest;
  return image.style.color !== "rgb[255, 255, 255]";
}

inputElem.addEventListener["change", [] => {
  if [validTextColor[inputElem.value]] {
    divElem.style.backgroundColor = inputElem.value;
    divElem.textContent = "";
  } else {
    divElem.style.backgroundColor = "white";
    divElem.textContent = "Invalid color value";
  }
}];
0 [lục] và
const inputElem = document.querySelector["input"];
const divElem = document.querySelector["div"];

function validTextColor[stringToTest] {
  if [stringToTest === ""] {
    return false;
  }
  if [stringToTest === "inherit"] {
    return false;
  }
  if [stringToTest === "transparent"] {
    return false;
  }

  const image = document.createElement["img"];
  image.style.color = "rgb[0, 0, 0]";
  image.style.color = stringToTest;
  if [image.style.color !== "rgb[0, 0, 0]"] {
    return true;
  }
  image.style.color = "rgb[255, 255, 255]";
  image.style.color = stringToTest;
  return image.style.color !== "rgb[255, 255, 255]";
}

inputElem.addEventListener["change", [] => {
  if [validTextColor[inputElem.value]] {
    divElem.style.backgroundColor = inputElem.value;
    divElem.textContent = "";
  } else {
    divElem.style.backgroundColor = "white";
    divElem.textContent = "Invalid color value";
  }
}];
1 [lam] có thể là
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
1 hoặc
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
2, trong đó số
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
3 tương ứng với
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
4.
const inputElem = document.querySelector["input"];
const divElem = document.querySelector["div"];

function validTextColor[stringToTest] {
  if [stringToTest === ""] {
    return false;
  }
  if [stringToTest === "inherit"] {
    return false;
  }
  if [stringToTest === "transparent"] {
    return false;
  }

  const image = document.createElement["img"];
  image.style.color = "rgb[0, 0, 0]";
  image.style.color = stringToTest;
  if [image.style.color !== "rgb[0, 0, 0]"] {
    return true;
  }
  image.style.color = "rgb[255, 255, 255]";
  image.style.color = stringToTest;
  return image.style.color !== "rgb[255, 255, 255]";
}

inputElem.addEventListener["change", [] => {
  if [validTextColor[inputElem.value]] {
    divElem.style.backgroundColor = inputElem.value;
    divElem.textContent = "";
  } else {
    divElem.style.backgroundColor = "white";
    divElem.textContent = "Invalid color value";
  }
}];
2 [alpha] có thể là một
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
1 trong khoảng từ
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
7 đến
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
8 hoặc một
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
2, trong đó số
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
8 tương ứng với
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
4 [độ mờ hoàn toàn]

Mô hình màu HSL xác định một màu nhất định trong không gian màu sRGB theo các thành phần màu sắc, độ bão hòa và độ sáng của nó. Một thành phần alpha tùy chọn thể hiện độ trong suốt của màu

Nhiều nhà thiết kế nhận thấy HSL trực quan hơn RGB, vì nó cho phép điều chỉnh màu sắc, độ bão hòa và độ sáng của từng màu một cách độc lập. HSL cũng có thể giúp việc tạo một tập hợp các màu phù hợp trở nên dễ dàng hơn [chẳng hạn như khi bạn muốn có nhiều sắc thái của một sắc độ]. Tuy nhiên, sử dụng HSL để tạo các biến thể màu có thể tạo ra kết quả đáng ngạc nhiên, vì nó không. Ví dụ: cả

/* These examples all specify the same color: a lavender. */
hsl[270,60%,70%]
hsl[270, 60%, 70%]
hsl[270 60% 70%]
hsl[270deg, 60%, 70%]
hsl[4.71239rad, 60%, 70%]
hsl[0.75turn, 60%, 70%]

/* These examples all specify the same color: a lavender that is 15% opaque. */
hsl[270, 60%, 50%, 0.15]
hsl[270, 60%, 50%, 0.15]
hsl[270, 60%, 50%, 15%]
hsl[270 60% 50% / 0.15]
hsl[270 60% 50% / 15%]
2 và
/* These examples all specify the same color: a lavender. */
hsl[270,60%,70%]
hsl[270, 60%, 70%]
hsl[270 60% 70%]
hsl[270deg, 60%, 70%]
hsl[4.71239rad, 60%, 70%]
hsl[0.75turn, 60%, 70%]

/* These examples all specify the same color: a lavender that is 15% opaque. */
hsl[270, 60%, 50%, 0.15]
hsl[270, 60%, 50%, 0.15]
hsl[270, 60%, 50%, 15%]
hsl[270 60% 50% / 0.15]
hsl[270 60% 50% / 15%]
3 đều có cùng độ sáng, mặc dù cái trước tối hơn nhiều so với cái sau

Màu HSL được thể hiện thông qua ký hiệu chức năng

 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

6

Ghi chú. Cú pháp kế thừa

/* These examples all specify the same color: a lavender. */
hsl[270,60%,70%]
hsl[270, 60%, 70%]
hsl[270 60% 70%]
hsl[270deg, 60%, 70%]
hsl[4.71239rad, 60%, 70%]
hsl[0.75turn, 60%, 70%]

/* These examples all specify the same color: a lavender that is 15% opaque. */
hsl[270, 60%, 50%, 0.15]
hsl[270, 60%, 50%, 0.15]
hsl[270, 60%, 50%, 15%]
hsl[270 60% 50% / 0.15]
hsl[270 60% 50% / 15%]
5 là bí danh của
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

6, chấp nhận các tham số giống nhau và hoạt động theo cùng một cách

Tương tự như mô hình màu HSL, mô hình màu HWB xác định một màu nhất định trong không gian màu sRGB theo các thành phần màu sắc, độ trắng và độ đen của nó

Cũng như HSL, HWB có thể sử dụng trực quan hơn RGB. Màu sắc được chỉ định theo cùng một cách, theo sau là lượng độ trắng và độ đen tương ứng theo giá trị phần trăm. Chức năng này cũng chấp nhận một giá trị alpha

Ghi chú. Không có hàm

/* These examples all specify the same color: a lavender. */
hsl[270,60%,70%]
hsl[270, 60%, 70%]
hsl[270 60% 70%]
hsl[270deg, 60%, 70%]
hsl[4.71239rad, 60%, 70%]
hsl[0.75turn, 60%, 70%]

/* These examples all specify the same color: a lavender that is 15% opaque. */
hsl[270, 60%, 50%, 0.15]
hsl[270, 60%, 50%, 0.15]
hsl[270, 60%, 50%, 15%]
hsl[270 60% 50% / 0.15]
hsl[270 60% 50% / 15%]
7 riêng biệt như với HSL, giá trị alpha là một tham số tùy chọn, nếu nó không được chỉ định thì giá trị alpha là 1 [hoặc 100%] sẽ được sử dụng. Để chỉ định giá trị này, dấu gạch chéo lên phía trước [_______63_______8] phải theo sau giá trị độ đen trước khi chỉ định giá trị alpha

Màu HWB được thể hiện thông qua ký hiệu

 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

7 chức năng

Ghi chú. Hàm HWB không dùng dấu phẩy để phân cách các giá trị như các hàm màu trước đây

 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

7.
/* These examples all specify varying shades of a lime green. */
hwb[90 10% 10%]
hwb[90 50% 10%]
hwb[90deg 10% 10%]
hwb[1.5708rad 60% 0%]
hwb[0.25turn 0% 40%]

/* Same lime green but with an alpha value */
hwb[90 10% 10% / 0.5]
hwb[90 10% 10% / 50%]
1

Tương tự với HSSL.

/* These examples all specify varying shades of a lime green. */
hwb[90 10% 10%]
hwb[90 50% 10%]
hwb[90deg 10% 10%]
hwb[1.5708rad 60% 0%]
hwb[0.25turn 0% 40%]

/* Same lime green but with an alpha value */
hwb[90 10% 10% / 0.5]
hwb[90 10% 10% / 50%]
2 [màu sắc] là một
/* These examples all specify varying shades of a lime green. */
hwb[90 10% 10%]
hwb[90 50% 10%]
hwb[90deg 10% 10%]
hwb[1.5708rad 60% 0%]
hwb[0.25turn 0% 40%]

/* Same lime green but with an alpha value */
hwb[90 10% 10% / 0.5]
hwb[90 10% 10% / 50%]
3 của vòng tròn màu được đưa ra trong
/* These examples all specify varying shades of a lime green. */
hwb[90 10% 10%]
hwb[90 50% 10%]
hwb[90deg 10% 10%]
hwb[1.5708rad 60% 0%]
hwb[0.25turn 0% 40%]

/* Same lime green but with an alpha value */
hwb[90 10% 10% / 0.5]
hwb[90 10% 10% / 50%]
4s,
/* These examples all specify varying shades of a lime green. */
hwb[90 10% 10%]
hwb[90 50% 10%]
hwb[90deg 10% 10%]
hwb[1.5708rad 60% 0%]
hwb[0.25turn 0% 40%]

/* Same lime green but with an alpha value */
hwb[90 10% 10% / 0.5]
hwb[90 10% 10% / 50%]
5s,
/* These examples all specify varying shades of a lime green. */
hwb[90 10% 10%]
hwb[90 50% 10%]
hwb[90deg 10% 10%]
hwb[1.5708rad 60% 0%]
hwb[0.25turn 0% 40%]

/* Same lime green but with an alpha value */
hwb[90 10% 10% / 0.5]
hwb[90 10% 10% / 50%]
6s hoặc
/* These examples all specify varying shades of a lime green. */
hwb[90 10% 10%]
hwb[90 50% 10%]
hwb[90deg 10% 10%]
hwb[1.5708rad 60% 0%]
hwb[0.25turn 0% 40%]

/* Same lime green but with an alpha value */
hwb[90 10% 10% / 0.5]
hwb[90 10% 10% / 50%]
7s trong thông số kỹ thuật. Khi được viết dưới dạng
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
1 không có đơn vị, nó được hiểu là độ, như được chỉ định trong thông số kỹ thuật. Theo định nghĩa, màu đỏ=0độ=360độ, với các màu khác trải rộng xung quanh vòng tròn, vì vậy màu lục=120độ,xanh dương=240độ,v.v. Là một
/* These examples all specify varying shades of a lime green. */
hwb[90 10% 10%]
hwb[90 50% 10%]
hwb[90deg 10% 10%]
hwb[1.5708rad 60% 0%]
hwb[0.25turn 0% 40%]

/* Same lime green but with an alpha value */
hwb[90 10% 10% / 0.5]
hwb[90 10% 10% / 50%]
3, nó hoàn toàn bao quanh sao cho -120deg=240deg, 480deg=120deg, -1turn=1turn, v.v.

hsl[240 100% 50% / 0.05]    /*   5% opaque blue */
hsl[240 100% 50% / 0.4]     /*  40% opaque blue */
hsl[240 100% 50% / 0.7]     /*  70% opaque blue */
hsl[240 100% 50% / 1]       /* full opaque blue */

/* Comma syntax */
hsl[240, 100%, 50%, 0.05]     /*   5% opaque blue */

/* Percentage value for alpha */
hsl[240 100% 50% / 5%]       /*   5% opaque blue */
0 [độ trắng] và
const inputElem = document.querySelector["input"];
const divElem = document.querySelector["div"];

function validTextColor[stringToTest] {
  if [stringToTest === ""] {
    return false;
  }
  if [stringToTest === "inherit"] {
    return false;
  }
  if [stringToTest === "transparent"] {
    return false;
  }

  const image = document.createElement["img"];
  image.style.color = "rgb[0, 0, 0]";
  image.style.color = stringToTest;
  if [image.style.color !== "rgb[0, 0, 0]"] {
    return true;
  }
  image.style.color = "rgb[255, 255, 255]";
  image.style.color = stringToTest;
  return image.style.color !== "rgb[255, 255, 255]";
}

inputElem.addEventListener["change", [] => {
  if [validTextColor[inputElem.value]] {
    divElem.style.backgroundColor = inputElem.value;
    divElem.textContent = "";
  } else {
    divElem.style.backgroundColor = "white";
    divElem.textContent = "Invalid color value";
  }
}];
1 [độ đen] là tỷ lệ phần trăm. Hai màu này trộn lẫn với nhau, vì vậy bạn sẽ cần
hsl[240 100% 50% / 0.05]    /*   5% opaque blue */
hsl[240 100% 50% / 0.4]     /*  40% opaque blue */
hsl[240 100% 50% / 0.7]     /*  70% opaque blue */
hsl[240 100% 50% / 1]       /* full opaque blue */

/* Comma syntax */
hsl[240, 100%, 50%, 0.05]     /*   5% opaque blue */

/* Percentage value for alpha */
hsl[240 100% 50% / 5%]       /*   5% opaque blue */
2 độ trắng và
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
4 độ đen để tạo ra màu đen. Và ngược lại
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
4 độ trắng và
hsl[240 100% 50% / 0.05]    /*   5% opaque blue */
hsl[240 100% 50% / 0.4]     /*  40% opaque blue */
hsl[240 100% 50% / 0.7]     /*  70% opaque blue */
hsl[240 100% 50% / 1]       /* full opaque blue */

/* Comma syntax */
hsl[240, 100%, 50%, 0.05]     /*   5% opaque blue */

/* Percentage value for alpha */
hsl[240 100% 50% / 5%]       /*   5% opaque blue */
2 độ đen cho màu trắng.
hsl[240 100% 50% / 0.05]    /*   5% opaque blue */
hsl[240 100% 50% / 0.4]     /*  40% opaque blue */
hsl[240 100% 50% / 0.7]     /*  70% opaque blue */
hsl[240 100% 50% / 1]       /* full opaque blue */

/* Comma syntax */
hsl[240, 100%, 50%, 0.05]     /*   5% opaque blue */

/* Percentage value for alpha */
hsl[240 100% 50% / 5%]       /*   5% opaque blue */
6 của cả hai giá trị hiển thị màu xám trung tính và bất kỳ biến thể nào khác có sắc thái của màu được chỉ định

const inputElem = document.querySelector["input"];
const divElem = document.querySelector["div"];

function validTextColor[stringToTest] {
  if [stringToTest === ""] {
    return false;
  }
  if [stringToTest === "inherit"] {
    return false;
  }
  if [stringToTest === "transparent"] {
    return false;
  }

  const image = document.createElement["img"];
  image.style.color = "rgb[0, 0, 0]";
  image.style.color = stringToTest;
  if [image.style.color !== "rgb[0, 0, 0]"] {
    return true;
  }
  image.style.color = "rgb[255, 255, 255]";
  image.style.color = stringToTest;
  return image.style.color !== "rgb[255, 255, 255]";
}

inputElem.addEventListener["change", [] => {
  if [validTextColor[inputElem.value]] {
    divElem.style.backgroundColor = inputElem.value;
    divElem.textContent = "";
  } else {
    divElem.style.backgroundColor = "white";
    divElem.textContent = "Invalid color value";
  }
}];
2 [alpha], tùy chọn, có thể là
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
1 trong khoảng từ
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
7 đến
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
8 hoặc
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
2, trong đó số
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
8 tương ứng với
/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]
4 [độ mờ hoàn toàn]. Khi chỉ định một giá trị alpha, nó phải được đặt trước bằng dấu gạch chéo lên [
/* These examples all specify the same color: a lavender. */
hsl[270,60%,70%]
hsl[270, 60%, 70%]
hsl[270 60% 70%]
hsl[270deg, 60%, 70%]
hsl[4.71239rad, 60%, 70%]
hsl[0.75turn, 60%, 70%]

/* These examples all specify the same color: a lavender that is 15% opaque. */
hsl[270, 60%, 50%, 0.15]
hsl[270, 60%, 50%, 0.15]
hsl[270, 60%, 50%, 15%]
hsl[270 60% 50% / 0.15]
hsl[270 60% 50% / 15%]
8]

Ở chế độ màu bắt buộc [có thể phát hiện được bằng truy vấn phương tiện màu bắt buộc], hầu hết các màu được giới hạn trong bảng màu do người dùng và trình duyệt xác định. Các màu hệ thống này được hiển thị bằng các từ khóa sau, có thể được sử dụng để đảm bảo rằng phần còn lại của trang tích hợp tốt với bảng màu hạn chế. Các giá trị này cũng có thể được sử dụng trong các ngữ cảnh khác, nhưng không được các trình duyệt hỗ trợ rộng rãi

Các từ khóa trong danh sách sau đây được xác định bởi đặc tả Mô-đun Màu CSS Cấp 4. _________05, _______0_______06, _______0_______07, _______0_______08, _______0_______09, _______ 10, _______ 11, _______0_______12, _______0_______13, _______0_______14, _______0_______15, _______ 0_______16, _______ 17, _______ 18, _______ 19, _______ 20, _______ 21, _______ 23, _______

Ghi chú. Lưu ý rằng những từ khóa này không phân biệt chữ hoa chữ thường nhưng được liệt kê ở đây với cả chữ hoa chữ thường để dễ đọc

CSS Color 4 giới thiệu màu Lab. Màu sắc phòng thí nghiệm được chỉ định thông qua ký hiệu chức năng

 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

9. Chúng không bị giới hạn trong một không gian màu cụ thể và có thể đại diện cho toàn bộ phổ thị giác của con người

CSS Color 4 giới thiệu màu LCH. Màu LCH được chỉ định thông qua ký hiệu chức năng

 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

8. Chúng không bị giới hạn trong một không gian màu cụ thể và có thể đại diện cho toàn bộ phổ thị giác của con người

Trên thực tế, LCH là dạng phân cực của Lab. Nó thân thiện với con người hơn Lab, vì các thành phần sắc độ và màu sắc của nó xác định chất lượng của màu mong muốn, trái ngược với việc pha trộn. Nó tương tự như HSL theo cách đó, mặc dù nó đồng nhất về mặt nhận thức hơn nhiều. Không giống như HSL mô tả cả

/* These examples all specify the same color: a lavender. */
hsl[270,60%,70%]
hsl[270, 60%, 70%]
hsl[270 60% 70%]
hsl[270deg, 60%, 70%]
hsl[4.71239rad, 60%, 70%]
hsl[0.75turn, 60%, 70%]

/* These examples all specify the same color: a lavender that is 15% opaque. */
hsl[270, 60%, 50%, 0.15]
hsl[270, 60%, 50%, 0.15]
hsl[270, 60%, 50%, 15%]
hsl[270 60% 50% / 0.15]
hsl[270 60% 50% / 15%]
3 và
/* These examples all specify the same color: a lavender. */
hsl[270,60%,70%]
hsl[270, 60%, 70%]
hsl[270 60% 70%]
hsl[270deg, 60%, 70%]
hsl[4.71239rad, 60%, 70%]
hsl[0.75turn, 60%, 70%]

/* These examples all specify the same color: a lavender that is 15% opaque. */
hsl[270, 60%, 50%, 0.15]
hsl[270, 60%, 50%, 0.15]
hsl[270, 60%, 50%, 15%]
hsl[270 60% 50% / 0.15]
hsl[270 60% 50% / 15%]
2 có cùng độ đậm nhạt, LCH [và Phòng thí nghiệm] mô tả chính xác độ đậm nhạt khác nhau cho chúng. cái trước [màu vàng] có L là 97. 6 và cái sau [màu xanh] L là 29. 6. Do đó, LCH có thể được sử dụng để tạo các bảng màu với các màu hoàn toàn khác nhau, với kết quả có thể dự đoán được. Xin lưu ý rằng sắc độ LCH không giống với sắc độ HSL và sắc độ LCH không giống với độ bão hòa HSL, mặc dù chúng có chung một số điểm tương đồng về khái niệm

CSS Color 4 đã giới thiệu ký hiệu này. Các màu được chỉ định thông qua hàm



Enter a valid color value:

0 có thể chỉ định một màu trong bất kỳ không gian màu nào được xác định trước, cũng như các không gian màu tùy chỉnh, được xác định thông qua quy tắc
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

29

Trong hoạt ảnh và chuyển màu, các giá trị

 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

0 được nội suy trên từng thành phần màu đỏ, xanh lá cây và xanh dương của chúng. Mỗi thành phần được nội suy dưới dạng một số thực, dấu phẩy động. Lưu ý rằng nội suy màu xảy ra trong để ngăn các màu xám không mong muốn xuất hiện. Trong hoạt ảnh, tốc độ của nội suy được xác định bởi chức năng thời gian

Một số người gặp khó khăn trong việc phân biệt màu sắc. Khuyến nghị khuyên bạn không nên sử dụng màu sắc làm phương tiện duy nhất để truyền tải một thông điệp, hành động hoặc kết quả cụ thể. Xem để biết thêm thông tin

 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

Trong ví dụ này, chúng tôi cung cấp một

 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

31 và một kiểu nhập văn bản. Việc nhập một màu hợp lệ vào đầu vào sẽ làm cho
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

31 áp dụng màu đó, cho phép bạn kiểm tra các giá trị màu của chúng tôi

HTML



Enter a valid color value:

CSS

div {
  width: 100%;
  height: 200px;
}

const inputElem = document.querySelector["input"];
const divElem = document.querySelector["div"];

function validTextColor[stringToTest] {
  if [stringToTest === ""] {
    return false;
  }
  if [stringToTest === "inherit"] {
    return false;
  }
  if [stringToTest === "transparent"] {
    return false;
  }

  const image = document.createElement["img"];
  image.style.color = "rgb[0, 0, 0]";
  image.style.color = stringToTest;
  if [image.style.color !== "rgb[0, 0, 0]"] {
    return true;
  }
  image.style.color = "rgb[255, 255, 255]";
  image.style.color = stringToTest;
  return image.style.color !== "rgb[255, 255, 255]";
}

inputElem.addEventListener["change", [] => {
  if [validTextColor[inputElem.value]] {
    divElem.style.backgroundColor = inputElem.value;
    divElem.textContent = "";
  } else {
    divElem.style.backgroundColor = "white";
    divElem.textContent = "Invalid color value";
  }
}];

Kết quả

Ví dụ này cho thấy nhiều cách có thể tạo một màu duy nhất bằng các cú pháp màu RGB khác nhau

/* These syntax variations all specify the same color: a fully opaque hot pink. */

/* Hexadecimal syntax */
#f09
#F09
#ff0099
#FF0099

/* Functional syntax */
rgb[255,0,153]
rgb[255, 0, 153]
rgb[255, 0, 153.0]
rgb[100%,0%,60%]
rgb[100%, 0%, 60%]
rgb[100%, 0, 60%] /* ERROR! Don't mix numbers and percentages. */
rgb[255 0 153]

/* Hexadecimal syntax with alpha value */
#f09f
#F09F
#ff0099ff
#FF0099FF

/* Functional syntax with alpha value */
rgb[255, 0, 153, 1]
rgb[255, 0, 153, .5]
rgb[255, 0, 153, 0.5]
rgb[255, 0, 153, 100%]

/* Whitespace syntax */
rgb[255 0 153 / 1]
rgb[255 0 153 / 100%]

/* Functional syntax with floats value */
rgb[255, 0, 153.6, 1]
rgb[2.55e2, 0e0, 1.53e2, 1e2%]

/* Hexadecimal syntax */
#3a30                    /*   0% opaque green */
#3a3f                    /* full opaque green */
#33aa3300                /*   0% opaque green */
#33aa3380                /*  50% opaque green */

/* Functional syntax */
rgba[51, 170, 51, 0.1]    /*  10% opaque green */
rgba[51, 170, 51, 0.4]    /*  40% opaque green */
rgba[51, 170, 51, 0.7]    /*  70% opaque green */
rgba[51, 170, 51,   1]    /* full opaque green */

/* Whitespace syntax */
rgba[51 170 51 / 0.4]    /*  40% opaque green */
rgba[51 170 51 / 40%]    /*  40% opaque green */

/* Functional syntax with floats value */
rgba[51,    170,   51.6,  1]
rgba[5.1e1, 1.7e2, 5.1e1, 1e2%]

/* These examples all specify the same color: a lavender. */
hsl[270,60%,70%]
hsl[270, 60%, 70%]
hsl[270 60% 70%]
hsl[270deg, 60%, 70%]
hsl[4.71239rad, 60%, 70%]
hsl[0.75turn, 60%, 70%]

/* These examples all specify the same color: a lavender that is 15% opaque. */
hsl[270, 60%, 50%, 0.15]
hsl[270, 60%, 50%, 0.15]
hsl[270, 60%, 50%, 15%]
hsl[270 60% 50% / 0.15]
hsl[270 60% 50% / 15%]

/* These examples all specify varying shades of a lime green. */
hwb[90 10% 10%]
hwb[90 50% 10%]
hwb[90deg 10% 10%]
hwb[1.5708rad 60% 0%]
hwb[0.25turn 0% 40%]

/* Same lime green but with an alpha value */
hwb[90 10% 10% / 0.5]
hwb[90 10% 10% / 50%]

NotationDescriptionLive

 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

33red
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

34orange
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

35yellow
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

36lime green
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

37green
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

38blue-green
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

39cyan
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

40sky blue
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

41blue
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

42purple
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

43magenta
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

44pink
 = 
|
currentcolor |


=
|
|
|
transparent

=
|
|
|
|
|
|
|
|
|


=
rgb[ [ | none ]{3} [ / [ | none ] ]? ] |
rgb[ [ | none ]{3} [ / [ | none ] ]? ]

=
hsl[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
hwb[ [ | none ] [ | none ] [ | none ] [ / [ | none ] ]? ]

=
lab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
lch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
oklab[ [ | | none ] [ | | none ] [ | | none ] [ / [ | none ] ]? ]

=
oklch[ [ | | none ] [ | | none ] [ | none ] [ / [ | none ] ]? ]

=
color[ [ / [ | none ] ]? ]

=
|


=
|


=
|


=
[ | | none ]{3}

=
[ | | none ]{3}

=
srgb |
srgb-linear |
display-p3 |
a98-rgb |
prophoto-rgb |
rec2020

=
xyz |
xyz-d50 |
xyz-d65

45red

Chủ Đề