{"id":81525,"date":"2023-03-14T13:59:23","date_gmt":"2023-03-14T13:59:23","guid":{"rendered":"https:\/\/www.globallogic.com\/latam\/?post_type=insightsection&#038;p=81525"},"modified":"2025-01-30T12:26:36","modified_gmt":"2025-01-30T12:26:36","slug":"contraste-de-color-aa-y-aaa-wcag-que-criteros-se-toman-en-cuenta","status":"publish","type":"insightsection","link":"https:\/\/www.globallogic.com\/latam\/insights\/white-papers\/contraste-de-color-aa-y-aaa-wcag-que-criteros-se-toman-en-cuenta\/","title":{"rendered":"Automatizando el criterio de contraste de color AA y AAA de WCAG"},"content":{"rendered":"<div class=\"classic_editor_content\"><em><span style=\"font-weight: 400\">Por <\/span><span style=\"font-weight: 400\">Pablo Javier Ruiz<\/span><span style=\"font-weight: 400\">, Associate Specialist QA Analyst.\u00a0<\/span><\/em><\/p>\n<p><span style=\"font-weight: 400\">Las personas con baja visi\u00f3n a menudo presentan dificultad para leer textos que no contrastan con su fondo y esto puede empeorar si la persona tiene una deficiencia en la visi\u00f3n del color que reduce a\u00fan m\u00e1s el contraste.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Proporcionar una relaci\u00f3n de contraste de luminancia m\u00ednima entre el texto y su fondo puede hacer que el texto sea m\u00e1s legible, incluso si la persona no ve la gama completa de colores (e incluso funciona para los individuos que no ven ning\u00fan color).<\/span><\/p>\n<p><span style=\"font-weight: 400\">La intenci\u00f3n del Criterio de Conformidad de Contraste de Color de las WCAG es proporcionar suficiente contraste entre el texto y su fondo, de forma de que pueda ser le\u00eddo por personas con una visi\u00f3n moderadamente baja (que no usan tecnolog\u00eda de asistencia para mejorar el contraste), y tambi\u00e9n las deficiencias de color pueden afectar un poco el contraste de luminancia. Por lo tanto, en este criterio, el contraste se calcula de tal forma que el color no es un factor clave, por lo que las personas que tienen d\u00e9ficit de visi\u00f3n crom\u00e1tica tambi\u00e9n tendr\u00e1n un contraste adecuado entre el texto y el fondo. Para comprender el m\u00ednimo de contraste, acceda <a rel=\"external nofollow\" target=\"_blank\" href=\"https:\/\/www.w3.org\/WAI\/WCAG22\/Understanding\/contrast-minimum.html\">aqu\u00ed<\/a>.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">Cualquier producto que pretenda cumplir con los criterios AA o AAA WCAG debe tener un contraste m\u00ednimo. El <a rel=\"external nofollow\" target=\"_blank\" href=\"https:\/\/www.w3.org\/WAI\/WCAG22\/Understanding\/contrast-minimum.html\">contraste 3:1<\/a><\/span><span style=\"font-weight: 400\"> es el m\u00ednimo esperado para texto y visi\u00f3n est\u00e1ndar, el nivel AA espera un contraste m\u00ednimo de 4.5:1 (recomendado para personas con visi\u00f3n 20\/40) y el nivel AAA espera un contraste m\u00ednimo de 7:1 (recomendado para personas con una visi\u00f3n de 20\/80 y tambi\u00e9n proporciona una mejora del contraste para la deficiencia de color). Acceda<\/span> <a rel=\"external nofollow\" target=\"_blank\" href=\"https:\/\/www.w3.org\/WAI\/GL\/wiki\/Contrast_ratio\"><span style=\"font-weight: 400\">aqu\u00ed<\/span><\/a><span style=\"font-weight: 400\"> a la <strong>explicaci\u00f3n de la escala de relaci\u00f3n de contraste.<\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">A continuaci\u00f3n, brindaremos algunas herramientas para crear funciones para probar esta relaci\u00f3n de contraste de manera automatizada, de modo que esta tediosa tarea pueda incluirse en su prueba de regresi\u00f3n de automatizaci\u00f3n.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Adjuntamos un ejemplo de este contraste en la<\/span><a rel=\"external nofollow\" target=\"_blank\" href=\"https:\/\/github.com\/\"> <span style=\"font-weight: 400\">p\u00e1gina de inicio de GitHub<\/span><\/a><span style=\"font-weight: 400\">. En esta p\u00e1gina podemos ver que se usa bajo contraste en los sitios de todos los d\u00edas:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-81566\" src=\"https:\/\/www.globallogic.com\/latam\/wp-content\/uploads\/sites\/5\/2023\/03\/Untitled-design-23-300x148.png\" alt=\"\" width=\"544\" height=\"268\" srcset=\"https:\/\/www.globallogic.com\/latam\/wp-content\/uploads\/sites\/5\/2023\/03\/Untitled-design-23-300x148.png 300w, https:\/\/www.globallogic.com\/latam\/wp-content\/uploads\/sites\/5\/2023\/03\/Untitled-design-23-1024x504.png 1024w, https:\/\/www.globallogic.com\/latam\/wp-content\/uploads\/sites\/5\/2023\/03\/Untitled-design-23-768x378.png 768w, https:\/\/www.globallogic.com\/latam\/wp-content\/uploads\/sites\/5\/2023\/03\/Untitled-design-23.png 1344w\" sizes=\"auto, (max-width: 544px) 100vw, 544px\" \/><br \/>\n<em>Se puede observar que el contraste entre el texto y el fondo es de 2,09:1.<\/em><\/p>\n<h2><b>F\u00f3rmula de contraste de color<\/b><\/h2>\n<p><span style=\"font-weight: 400\">La f\u00f3rmula de contraste de color en el sitio WCAG utiliza una f\u00f3rmula simple:<\/span><\/p>\n<p><span style=\"font-weight: 400\"><strong>(L1 + 0.05) \/ (L2 + 0.05)<\/strong> <\/span><span style=\"font-weight: 400\">, donde<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u00a0\u00a0<\/span> <span style=\"font-weight: 400\">L1 es la luminancia relativa del m\u00e1s claro de los colores, y<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u00a0<\/span> <span style=\"font-weight: 400\">L2 es la luminancia relativa del m\u00e1s oscuro de los colores.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">Si ponemos esto en una funci\u00f3n JavaScript:<\/span><\/p>\n<blockquote>\n<pre><span style=\"font-weight: 400\">funci\u00f3n<\/span><span style=\"font-weight: 400\"> relaci\u00f3n de <\/span><span style=\"font-weight: 400\">contraste <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">color1 <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">color2 <\/span><span style=\"font-weight: 400\">) {<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">\/\/ convertir los valores RGB a luminancia<\/span>\n\n<span style=\"font-weight: 400\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400\">constante<\/span> <span style=\"font-weight: 400\">lum1 <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">luminancia <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">color1 <\/span><span style=\"font-weight: 400\">);<\/span>\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">constante<\/span> <span style=\"font-weight: 400\">lum2 <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">luminancia <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">color2 <\/span><span style=\"font-weight: 400\">);\n<\/span><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">\/\/ calcular el contraste<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">dejar<\/span> <span style=\"font-weight: 400\">contraste <\/span><span style=\"font-weight: 400\">= ( <\/span><span style=\"font-weight: 400\">Math <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">max <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">lum1 <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">lum2 <\/span><span style=\"font-weight: 400\">) + <\/span><span style=\"font-weight: 400\">0.05 <\/span><span style=\"font-weight: 400\">) \/ ( <\/span><span style=\"font-weight: 400\">Math <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">min <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">lum1 <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">lum2 <\/span><span style=\"font-weight: 400\">) + <\/span><span style=\"font-weight: 400\">0.05 <\/span><span style=\"font-weight: 400\">);<\/span>\n\n\n\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">\/\/ Devuelve el contraste redondeado a 2 decimales<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">devolver<\/span> <span style=\"font-weight: 400\">matem\u00e1ticas <\/span><span style=\"font-weight: 400\">_ <\/span><span style=\"font-weight: 400\">redondo <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">contraste <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">100 <\/span><span style=\"font-weight: 400\">)\/ <\/span><span style=\"font-weight: 400\">100 <\/span><span style=\"font-weight: 400\">;\n<\/span><span style=\"font-weight: 400\">}<\/span>\n\n\n<\/pre>\n<\/blockquote>\n<p><span style=\"font-weight: 400\">Donde la <strong>luminancia [4]<\/strong>\u00a0se calcula con esta funci\u00f3n:<\/span><\/p>\n<pre><span style=\"font-weight: 400\">funci\u00f3n<\/span> <span style=\"font-weight: 400\">luminancia <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">) {<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">\/\/ Convertir el color RGB a luminancia<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">dejar<\/span> <span style=\"font-weight: 400\">r <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">r <\/span><span style=\"font-weight: 400\">\/ <\/span><span style=\"font-weight: 400\">255 <\/span><span style=\"font-weight: 400\">;<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">dejar<\/span> <span style=\"font-weight: 400\">g <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">g <\/span><span style=\"font-weight: 400\">\/ <\/span><span style=\"font-weight: 400\">255 <\/span><span style=\"font-weight: 400\">;<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">dejar<\/span> <span style=\"font-weight: 400\">b <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">b <\/span><span style=\"font-weight: 400\">\/ <\/span><span style=\"font-weight: 400\">255 <\/span><span style=\"font-weight: 400\">;<\/span><\/pre>\n<p><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0<\/span><\/p>\n<pre><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">\/\/ Aplicar la f\u00f3rmula de luminancia<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">r <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">r <\/span><span style=\"font-weight: 400\">&lt;= <\/span><span style=\"font-weight: 400\">0.03928 <\/span><span style=\"font-weight: 400\">? <\/span><span style=\"font-weight: 400\">r <\/span><span style=\"font-weight: 400\">\/ <\/span><span style=\"font-weight: 400\">12.92 <\/span><span style=\"font-weight: 400\">: <\/span><span style=\"font-weight: 400\">Matem\u00e1ticas <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">pow <\/span><span style=\"font-weight: 400\">(( <\/span><span style=\"font-weight: 400\">r <\/span><span style=\"font-weight: 400\">+ <\/span><span style=\"font-weight: 400\">0,055 <\/span><span style=\"font-weight: 400\">) \/ <\/span><span style=\"font-weight: 400\">1,055 <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">2,4 <\/span><span style=\"font-weight: 400\">);<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">gramo <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">gramo <\/span><span style=\"font-weight: 400\">&lt;= <\/span><span style=\"font-weight: 400\">0.03928 <\/span><span style=\"font-weight: 400\">? <\/span><span style=\"font-weight: 400\">g <\/span><span style=\"font-weight: 400\">\/ <\/span><span style=\"font-weight: 400\">12.92 <\/span><span style=\"font-weight: 400\">: <\/span><span style=\"font-weight: 400\">Matem\u00e1ticas <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">pow <\/span><span style=\"font-weight: 400\">(( <\/span><span style=\"font-weight: 400\">g <\/span><span style=\"font-weight: 400\">+ <\/span><span style=\"font-weight: 400\">0,055 <\/span><span style=\"font-weight: 400\">)\/ <\/span><span style=\"font-weight: 400\">1,055 <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">2,4 <\/span><span style=\"font-weight: 400\">);<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">b <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">b <\/span><span style=\"font-weight: 400\">&lt;= <\/span><span style=\"font-weight: 400\">0.03928 <\/span><span style=\"font-weight: 400\">? <\/span><span style=\"font-weight: 400\">b <\/span><span style=\"font-weight: 400\">\/ <\/span><span style=\"font-weight: 400\">12.92 <\/span><span style=\"font-weight: 400\">: <\/span><span style=\"font-weight: 400\">Matem\u00e1ticas <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">pow <\/span><span style=\"font-weight: 400\">(( <\/span><span style=\"font-weight: 400\">b <\/span><span style=\"font-weight: 400\">+ <\/span><span style=\"font-weight: 400\">0,055 <\/span><span style=\"font-weight: 400\">)\/ <\/span><span style=\"font-weight: 400\">1,055 <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">2,4 <\/span><span style=\"font-weight: 400\">);<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">devolver<\/span> <span style=\"font-weight: 400\">0,2126 <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">r <\/span><span style=\"font-weight: 400\">+ <\/span><span style=\"font-weight: 400\">0,7152 <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">g <\/span><span style=\"font-weight: 400\">+ <\/span><span style=\"font-weight: 400\">0,0722 <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">b <\/span><span style=\"font-weight: 400\">;<\/span>\n\n<strong>\u00a0Acceda <a rel=\"external nofollow\" target=\"_blank\" href=\"https:\/\/www.w3.org\/WAI\/GL\/wiki\/Relative_luminance#:~:text=Definition%20as%20Stated%20in%20WCAG%202.,-x&amp;text=Note%201%3A%20For%20the%20sRGB,%2B0.055)%2F1.055)%20%5E%202.4\">aqu\u00ed <\/a>a la f\u00f3rmula de luminancia relativa.\u00a0<\/strong>\n\n\n<\/pre>\n<p><span style=\"font-weight: 400\">Un ejemplo de c\u00f3mo utilizar esta funci\u00f3n:<\/span><\/p>\n<pre><span style=\"font-weight: 400\">constante<\/span> <span style=\"font-weight: 400\">color1 <\/span><span style=\"font-weight: 400\">= { <\/span><span style=\"font-weight: 400\">r:<\/span> <span style=\"font-weight: 400\">255 <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">g:<\/span> <span style=\"font-weight: 400\">99 <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">segundo:<\/span> <span style=\"font-weight: 400\">71 <\/span><span style=\"font-weight: 400\">};<\/span>\n\n<span style=\"font-weight: 400\">constante<\/span> <span style=\"font-weight: 400\">color2 <\/span><span style=\"font-weight: 400\">= { <\/span><span style=\"font-weight: 400\">r:<\/span> <span style=\"font-weight: 400\">245 <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">g:<\/span> <span style=\"font-weight: 400\">245 <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">segundo:<\/span> <span style=\"font-weight: 400\">245 <\/span><span style=\"font-weight: 400\">};<\/span>\n\n<span style=\"font-weight: 400\">\u00a0<\/span>\n\n<span style=\"font-weight: 400\">consola <\/span><span style=\"font-weight: 400\">_ <\/span><span style=\"font-weight: 400\">log <\/span><span style=\"font-weight: 400\">( relaci\u00f3n de <\/span><span style=\"font-weight: 400\">contraste <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">color1 <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">color2 <\/span><span style=\"font-weight: 400\">)); <\/span><span style=\"font-weight: 400\">\/\/ imprime 1.35, lo que significa 1.35: 1 de contraste<\/span><\/pre>\n<p><span style=\"font-weight: 400\">\u00a0<\/span><\/p>\n<h2><b>Comprender el impacto del daltonismo<\/b><\/h2>\n<p><span style=\"font-weight: 400\">El daltonismo es una deficiencia de la visi\u00f3n del color, en la que la persona presenta dificultad para ver cierto color o distinguir entre ciertos colores. Adem\u00e1s, algunas formas de daltonismo pueden afectar la percepci\u00f3n de la luminancia.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Hay varios tipos de deficiencia de la visi\u00f3n del color, pero los m\u00e1s comunes son:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400\"> \u00a0 <\/span> <span style=\"font-weight: 400\">La <\/span><strong><i>protanopia<\/i><\/strong><span style=\"font-weight: 400\"> es un tipo de daltonismo rojo-verde causado por una mutaci\u00f3n gen\u00e9tica que afecta la forma en que los <\/span><i><span style=\"font-weight: 400\">conos rojos del ojo <\/span><\/i><span style=\"font-weight: 400\">procesan la informaci\u00f3n del color. Las personas con <\/span><i><span style=\"font-weight: 400\">protanopia <\/span><\/i><span style=\"font-weight: 400\">tienen dificultad para distinguir entre tonos rojos y verdes.<\/span><\/li>\n<li><span style=\"font-weight: 400\"> \u00a0 <\/span> <span style=\"font-weight: 400\">La <\/span><strong><i>deuteranop\u00eda<\/i><\/strong><span style=\"font-weight: 400\"> tambi\u00e9n es un tipo de daltonismo rojo-verde causado por una mutaci\u00f3n gen\u00e9tica, pero afecta la forma en que las <\/span><i><span style=\"font-weight: 400\">c\u00e9lulas del cono verde del ojo <\/span><\/i><span style=\"font-weight: 400\">procesan la informaci\u00f3n del color. Las personas con <\/span><i><span style=\"font-weight: 400\">deuteranop\u00eda <\/span><\/i><span style=\"font-weight: 400\">tambi\u00e9n tienen dificultad para distinguir entre tonos rojos y verdes.<\/span><\/li>\n<li><span style=\"font-weight: 400\"> \u00a0 <\/span> <span style=\"font-weight: 400\">La <\/span><strong><i>tritanopia<\/i><\/strong><span style=\"font-weight: 400\"> es un tipo raro de daltonismo azul-amarillo causado por una mutaci\u00f3n gen\u00e9tica que afecta la forma en que las <\/span><i><span style=\"font-weight: 400\">c\u00e9lulas del cono azul del ojo <\/span><\/i><span style=\"font-weight: 400\">procesan la informaci\u00f3n del color. Las personas con <\/span><i><span style=\"font-weight: 400\">tritanopia <\/span><\/i><span style=\"font-weight: 400\">tienen dificultad para distinguir entre tonos azules y amarillos.<\/span><\/li>\n<li><span style=\"font-weight: 400\">\u00a0 <\/span><span style=\"font-weight: 400\">La <\/span><strong><i>acromatopsia<\/i><\/strong><span style=\"font-weight: 400\"> (tambi\u00e9n conocida como daltonismo total) es un tipo extremadamente extra\u00f1o de daltonismo causado por un mal funcionamiento en los tres tipos de c\u00e9lulas c\u00f3nicas del ojo. Las personas con <\/span><i><span style=\"font-weight: 400\">acromatopsia <\/span><\/i><span style=\"font-weight: 400\">tienen dificultad para ver cualquier color y solo ven tonos de gris.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">Esas variaciones afectan la luminancia de los colores en algunos casos. Por ejemplo, verifiquemos el contraste entre el fondo y los colores de fuente, en esta p\u00e1gina inalterada en la p\u00e1gina de destino de GitHub:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-81570\" src=\"https:\/\/www.globallogic.com\/latam\/wp-content\/uploads\/sites\/5\/2023\/03\/Untitled-design-24-300x129.png\" alt=\"\" width=\"580\" height=\"249\" srcset=\"https:\/\/www.globallogic.com\/latam\/wp-content\/uploads\/sites\/5\/2023\/03\/Untitled-design-24-300x129.png 300w, https:\/\/www.globallogic.com\/latam\/wp-content\/uploads\/sites\/5\/2023\/03\/Untitled-design-24-1024x441.png 1024w, https:\/\/www.globallogic.com\/latam\/wp-content\/uploads\/sites\/5\/2023\/03\/Untitled-design-24-768x331.png 768w, https:\/\/www.globallogic.com\/latam\/wp-content\/uploads\/sites\/5\/2023\/03\/Untitled-design-24.png 1347w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/p>\n<p><span style=\"font-weight: 400\">Aqu\u00ed uso la consola del navegador para verificar los colores y uso el sitio <\/span><strong><a rel=\"external nofollow\" target=\"_blank\" href=\"https:\/\/webaim.org\/resources\/contrastchecker\/\">WebAIM<\/a><\/strong><span style=\"font-weight: 400\"> para verificar el contraste (marcado con el cuadro blanco). Podemos ver que el contraste entre el fondo y el color del texto es de 3,08:1 (justo por encima del est\u00e1ndar m\u00ednimo de 3:1)<\/span><\/p>\n<p><span style=\"font-weight: 400\">En este mismo ejemplo, como simulamos Deuteranop\u00eda <\/span><span style=\"font-weight: 400\">[6]<\/span><span style=\"font-weight: 400\">(usando una aproximaci\u00f3n, ya que hay varios grados) Usando el complemento de Chrome<\/span><strong><a rel=\"external nofollow\" target=\"_blank\" href=\"https:\/\/chrome.google.com\/webstore\/detail\/colorblindly\/floniaahmccleoclneebhhmnjgdfijgg\"> Colorblindly<\/a><\/strong><span style=\"font-weight: 400\">, podemos ver esto:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-81571\" src=\"https:\/\/www.globallogic.com\/latam\/wp-content\/uploads\/sites\/5\/2023\/03\/Untitled-design-25-300x129.png\" alt=\"\" width=\"646\" height=\"278\" srcset=\"https:\/\/www.globallogic.com\/latam\/wp-content\/uploads\/sites\/5\/2023\/03\/Untitled-design-25-300x129.png 300w, https:\/\/www.globallogic.com\/latam\/wp-content\/uploads\/sites\/5\/2023\/03\/Untitled-design-25-1024x441.png 1024w, https:\/\/www.globallogic.com\/latam\/wp-content\/uploads\/sites\/5\/2023\/03\/Untitled-design-25-768x331.png 768w, https:\/\/www.globallogic.com\/latam\/wp-content\/uploads\/sites\/5\/2023\/03\/Untitled-design-25.png 1347w\" sizes=\"auto, (max-width: 646px) 100vw, 646px\" \/><\/p>\n<p><span style=\"font-weight: 400\">Podemos percibir que la alteraci\u00f3n de la percepci\u00f3n del color tiene una peque\u00f1a degradaci\u00f3n en la luminancia de los colores, dando una relaci\u00f3n de contraste de 2,44:1, quedando el contraste justo por debajo del nivel m\u00ednimo aceptado.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">Puede simular el daltonismo para probar eso, aqu\u00ed hay un ejemplo de c\u00f3mo simular Deuteranop\u00eda, convirtiendo el color RGB al espacio de color LMS (el <\/span><a rel=\"external nofollow\" target=\"_blank\" href=\"https:\/\/en.wikipedia.org\/wiki\/LMS_color_space\"><span style=\"font-weight: 400\"><strong>LSM<\/strong> <\/span><\/a><span style=\"font-weight: 400\">es una representaci\u00f3n m\u00e1s precisa de c\u00f3mo los ojos ven los colores):<\/span><\/p>\n<pre><span style=\"font-weight: 400\">funci\u00f3n<\/span> <span style=\"font-weight: 400\">simularDeuteranop\u00eda <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">) {<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">\/\/ Convertir el color RGB al espacio de color LMS<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">dejar<\/span> <span style=\"font-weight: 400\">L <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">0,3811 <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">r <\/span><span style=\"font-weight: 400\">+ <\/span><span style=\"font-weight: 400\">0,5783 <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">g <\/span><span style=\"font-weight: 400\">+ <\/span><span style=\"font-weight: 400\">0.0402 <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">segundo <\/span><span style=\"font-weight: 400\">;<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">dejar<\/span> <span style=\"font-weight: 400\">M <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">0,1967 <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">r <\/span><span style=\"font-weight: 400\">+ <\/span><span style=\"font-weight: 400\">0,7244 <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">g <\/span><span style=\"font-weight: 400\">+ <\/span><span style=\"font-weight: 400\">0.0782 <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">segundo <\/span><span style=\"font-weight: 400\">;<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">dejar<\/span> <span style=\"font-weight: 400\">S <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">0,0241 <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">r <\/span><span style=\"font-weight: 400\">+ <\/span><span style=\"font-weight: 400\">0.1288 <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">g <\/span><span style=\"font-weight: 400\">+ <\/span><span style=\"font-weight: 400\">0.8444 <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">segundo <\/span><span style=\"font-weight: 400\">;<\/span><\/pre>\n<p><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0<\/span><\/p>\n<pre><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">\/\/ Aplicando la matriz de correcci\u00f3n de deuteranop\u00eda<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">dejar<\/span> <span style=\"font-weight: 400\">nuevoL <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">L <\/span><span style=\"font-weight: 400\">;<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">dejar<\/span> <span style=\"font-weight: 400\">nuevoM <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">0,9848 <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">M <\/span><span style=\"font-weight: 400\">;<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">dejar<\/span> <span style=\"font-weight: 400\">nuevoS <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">S <\/span><span style=\"font-weight: 400\">;<\/span><\/pre>\n<p><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0<\/span><\/p>\n<pre><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">\/\/ Convertir color LMS a RGB<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">_ <\/span><span style=\"font-weight: 400\">r <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">nuevoL <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">3,0632 <\/span><span style=\"font-weight: 400\">- <\/span><span style=\"font-weight: 400\">nuevoM <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">1,3932 <\/span><span style=\"font-weight: 400\">- <\/span><span style=\"font-weight: 400\">nuevoS <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">0,5688 <\/span><span style=\"font-weight: 400\">;<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">_ <\/span><span style=\"font-weight: 400\">g <\/span><span style=\"font-weight: 400\">= - <\/span><span style=\"font-weight: 400\">nuevaL <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">0,9692 <\/span><span style=\"font-weight: 400\">+ <\/span><span style=\"font-weight: 400\">nuevaM <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">1,8760 <\/span><span style=\"font-weight: 400\">+ <\/span><span style=\"font-weight: 400\">nuevaS <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">0,0416 <\/span><span style=\"font-weight: 400\">;<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">_ <\/span><span style=\"font-weight: 400\">b <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">nuevoL <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">0.0689 <\/span><span style=\"font-weight: 400\">- <\/span><span style=\"font-weight: 400\">nuevoM <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">0.2298 <\/span><span style=\"font-weight: 400\">+ <\/span><span style=\"font-weight: 400\">nuevoS <\/span><span style=\"font-weight: 400\">* <\/span><span style=\"font-weight: 400\">1.0693 <\/span><span style=\"font-weight: 400\">;<\/span><\/pre>\n<p><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0<\/span><\/p>\n<pre><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">\/\/ Fijar los valores al rango RGB v\u00e1lido<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">_ <\/span><span style=\"font-weight: 400\">r <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">Matem\u00e1ticas <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">min <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">Matem\u00e1ticas <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">max <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">r <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">0 <\/span><span style=\"font-weight: 400\">), <\/span><span style=\"font-weight: 400\">255 <\/span><span style=\"font-weight: 400\">);<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">_ <\/span><span style=\"font-weight: 400\">g <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">Matem\u00e1ticas <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">min <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">Matem\u00e1ticas <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">max <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">g <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">0 <\/span><span style=\"font-weight: 400\">), <\/span><span style=\"font-weight: 400\">255 <\/span><span style=\"font-weight: 400\">);<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">_ <\/span><span style=\"font-weight: 400\">b <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">Matem\u00e1ticas <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">min <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">Matem\u00e1ticas <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">max <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">b <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">0 <\/span><span style=\"font-weight: 400\">), <\/span><span style=\"font-weight: 400\">255 <\/span><span style=\"font-weight: 400\">);<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">devolver<\/span> <span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">;<\/span>\n\n<span style=\"font-weight: 400\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400\">\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">Y podemos sobrecargar la funci\u00f3n <\/span><span style=\"font-weight: 400\">contrastRatio ( ) <\/span><span style=\"font-weight: 400\">anterior para verificar diferentes tipos de degradaci\u00f3n del color:<\/span><\/p>\n<pre><span style=\"font-weight: 400\">funci\u00f3n<\/span><span style=\"font-weight: 400\"> relaci\u00f3n de <\/span><span style=\"font-weight: 400\">contraste <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">color1 <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">color2 <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">tipo <\/span><span style=\"font-weight: 400\">) {<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">dejar<\/span> <span style=\"font-weight: 400\">color1_simulado <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">color2_simulado <\/span><span style=\"font-weight: 400\">;<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">cambiar <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">tipo <\/span><span style=\"font-weight: 400\">){<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">caso<\/span> <span style=\"font-weight: 400\">'deuteranop\u00eda' <\/span><span style=\"font-weight: 400\">:<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">color1_simulado <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">simularProtanopia <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">color1 <\/span><span style=\"font-weight: 400\">);<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">color2_simulado <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">simularProtanopia <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">color2 <\/span><span style=\"font-weight: 400\">);<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">romper <\/span><span style=\"font-weight: 400\">;<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">\/\/ caso 'protanopia':<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">\/\/ caso 'tritanopia':<\/span>\n\n<span style=\"font-weight: 400\">\/\/ ...<\/span>\n\n<span style=\"font-weight: 400\">}<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">\/\/ convertir los valores RGB a luminancia<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">constante<\/span> <span style=\"font-weight: 400\">lum1 <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">luminancia <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">color1_simulado <\/span><span style=\"font-weight: 400\">);<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">\/\/ ...<\/span>\n\n<span style=\"font-weight: 400\">}<\/span>\n\n<span style=\"font-weight: 400\">\u00a0<\/span><\/pre>\n<p><span style=\"font-weight: 400\">Pero, en lugar de sobrecargar la funci\u00f3n para comprobar diferentes tipos de degradaci\u00f3n del color, podemos utilizar el criterio de contraste 7:1 AAA WCAG (en lugar del 4,5:1 de la lista AA). Al hacer esto, podemos asegurarnos de que todo el texto de una aplicaci\u00f3n se pueda leer correctamente, incluso con desviaciones de color y otras deficiencias visuales.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u00a0<\/span><\/p>\n<h2><b>Un ejemplo en Cypress<\/b><\/h2>\n<p><span style=\"font-weight: 400\">Aqu\u00ed hay un ejemplo simple de c\u00f3mo verificar el contraste de color entre el color de fondo y el color del texto en una p\u00e1gina, usando la funci\u00f3n <\/span><span style=\"font-weight: 400\">contrastRatio ( ) mencionada anteriormente<\/span><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u00a0<\/span><\/p>\n<pre><span style=\"font-weight: 400\">describe <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">\"Contraste de color de fondo vs. texto en la prueba del cuerpo\" <\/span><span style=\"font-weight: 400\">, () <\/span><span style=\"font-weight: 400\">=&gt; <\/span><span style=\"font-weight: 400\">{<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">\/\/ usando el const min_contrast en lugar de una definici\u00f3n global. para este ejemplo<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">constante<\/span> <span style=\"font-weight: 400\">min_contraste <\/span><span style=\"font-weight: 400\">= <\/span><span style=\"font-weight: 400\">4.5 <\/span><span style=\"font-weight: 400\">;<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">eso <\/span><span style=\"font-weight: 400\">_ <\/span><span style=\"font-weight: 400\">only <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">'Verificar el contraste entre el fondo y el color del texto en el cuerpo' <\/span><span style=\"font-weight: 400\">, () <\/span><span style=\"font-weight: 400\">=&gt; <\/span><span style=\"font-weight: 400\">{<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">cy <\/span><span style=\"font-weight: 400\">_ <\/span><span style=\"font-weight: 400\">visita <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">'https:\/\/sometesturl:9090' <\/span><span style=\"font-weight: 400\">);<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">cy <\/span><span style=\"font-weight: 400\">_ <\/span><span style=\"font-weight: 400\">obtener <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">'ul li' <\/span><span style=\"font-weight: 400\">). <\/span><span style=\"font-weight: 400\">cada <\/span><span style=\"font-weight: 400\">(( <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">fuente-color <\/span><span style=\"font-weight: 400\">) <\/span><span style=\"font-weight: 400\">=&gt; <\/span><span style=\"font-weight: 400\">{<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">\/\/ comprueba si hay un contraste mayor que igual al m\u00ednimo<\/span>\n\n<span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">expect <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">contrasteRatio <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">color <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">font-color <\/span><span style=\"font-weight: 400\">). <\/span><span style=\"font-weight: 400\">should <\/span><span style=\"font-weight: 400\">( <\/span><span style=\"font-weight: 400\">' be.gte ' <\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">min_contrast <\/span><span style=\"font-weight: 400\">));<\/span>\n\n<span style=\"font-weight: 400\">});<\/span>\n\n<span style=\"font-weight: 400\">});<\/span>\n\n<span style=\"font-weight: 400\">});<\/span><\/pre>\n<h2><b>Conclusiones<\/b><\/h2>\n<p><span style=\"font-weight: 400\">En este art\u00edculo aprendimos qu\u00e9 es el contraste de color y su importancia. Se proporcionaron algunas herramientas manuales (<\/span><a rel=\"external nofollow\" target=\"_blank\" href=\"https:\/\/chrome.google.com\/webstore\/detail\/colorblindly\/floniaahmccleoclneebhhmnjgdfijgg\"><span style=\"font-weight: 400\">complemento Colorblindly<\/span><\/a><span style=\"font-weight: 400\"> y sitio <\/span><a rel=\"external nofollow\" target=\"_blank\" href=\"https:\/\/webaim.org\/resources\/contrastchecker\/\"><span style=\"font-weight: 400\">WebAIM<\/span><\/a><span style=\"font-weight: 400\"> para verificaci\u00f3n manual), pero la posibilidad de automatizar estas pruebas y hacerlo para verificar correctamente incluso cuando la p\u00e1gina cambia, es una ventaja que no debe pasarse por alto, ya que los est\u00e1ndares WCAG son solicitado por m\u00e1s sitios cada d\u00eda.<\/span><\/p>\n<div id=\"simple-translate\" class=\"simple-translate-light-theme\">\n<div>\n<div class=\"simple-translate-button isShow\" style=\"height: 22px;width: 22px;top: 7113px;left: 62px\"><\/div>\n<div class=\"simple-translate-panel \" style=\"width: 300px;height: 200px;top: 0px;left: 0px;font-size: 13px\">\n<div class=\"simple-translate-result-wrapper\" style=\"overflow: hidden\">\n<div class=\"simple-translate-move\"><\/div>\n<div class=\"simple-translate-result-contents\">\n<p class=\"simple-translate-candidate\" dir=\"auto\">\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Las pautas de accesibilidad al contenido web (WCAG \/ Web Content Accessibility Guidelines) definen c\u00f3mo hacer que el contenido web sea m\u00e1s accesible para las personas con discapacidades. El contraste de color es uno de los criterios de las WCAG para garantizar que las personas con discapacidad visual puedan acceder f\u00e1cilmente a la lectura del texto y otros elementos.<\/p>\n","protected":false},"author":47,"featured_media":82390,"parent":0,"menu_order":41,"template":"","insight":[43],"insight-subcats":[780],"insight-industry":[779],"insight-services":[800],"insight-partners":[],"class_list":["post-81525","insightsection","type-insightsection","status-publish","has-post-thumbnail","hentry","insight-white-papers","insight-subcats-testing-as-a-service","insight-industry-cross-industry","insight-services-product-strategy-experience-design"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.globallogic.com\/latam\/wp-json\/wp\/v2\/insightsection\/81525","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globallogic.com\/latam\/wp-json\/wp\/v2\/insightsection"}],"about":[{"href":"https:\/\/www.globallogic.com\/latam\/wp-json\/wp\/v2\/types\/insightsection"}],"author":[{"embeddable":true,"href":"https:\/\/www.globallogic.com\/latam\/wp-json\/wp\/v2\/users\/47"}],"version-history":[{"count":1,"href":"https:\/\/www.globallogic.com\/latam\/wp-json\/wp\/v2\/insightsection\/81525\/revisions"}],"predecessor-version":[{"id":100986,"href":"https:\/\/www.globallogic.com\/latam\/wp-json\/wp\/v2\/insightsection\/81525\/revisions\/100986"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.globallogic.com\/latam\/wp-json\/wp\/v2\/media\/82390"}],"wp:attachment":[{"href":"https:\/\/www.globallogic.com\/latam\/wp-json\/wp\/v2\/media?parent=81525"}],"wp:term":[{"taxonomy":"insight","embeddable":true,"href":"https:\/\/www.globallogic.com\/latam\/wp-json\/wp\/v2\/insight?post=81525"},{"taxonomy":"insight-subcats","embeddable":true,"href":"https:\/\/www.globallogic.com\/latam\/wp-json\/wp\/v2\/insight-subcats?post=81525"},{"taxonomy":"insight-industry","embeddable":true,"href":"https:\/\/www.globallogic.com\/latam\/wp-json\/wp\/v2\/insight-industry?post=81525"},{"taxonomy":"insight-services","embeddable":true,"href":"https:\/\/www.globallogic.com\/latam\/wp-json\/wp\/v2\/insight-services?post=81525"},{"taxonomy":"insight-partners","embeddable":true,"href":"https:\/\/www.globallogic.com\/latam\/wp-json\/wp\/v2\/insight-partners?post=81525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}