{"id":35840,"date":"2021-11-25T14:48:59","date_gmt":"2021-11-25T14:48:59","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=35840"},"modified":"2021-11-25T14:48:59","modified_gmt":"2021-11-25T14:48:59","slug":"gtk-app-check-contrast-ratio-linux","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2021\/11\/gtk-app-check-contrast-ratio-linux\/","title":{"rendered":"This GTK App Checks Contrast Ratio Between 2 Colors in Ubuntu Linux"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-icon.webp\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-icon-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" class=\"alignleft size-thumbnail wp-image-35841\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-icon-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-icon-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-icon-600x600.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-icon-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-icon.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>Designers and website developers may sometimes need to check <b><a href=\"https:\/\/en.wikipedia.org\/wiki\/Web_Content_Accessibility_Guidelines\" rel=\"noopener\" target=\"_blank\">WCAG<\/a> color contrast<\/b> to make web content more accessible to people with disabilities.<\/p>\n<p>Without using an online website each time, Linux has a stylish GTK4 app <a href=\"https:\/\/gitlab.gnome.org\/World\/design\/contrast\" rel=\"noopener\" target=\"_blank\">&#8220;Contrast&#8221;<\/a> which allows to check whether the contrast between two colors meet the WCAG requirements.<\/p>\n<p>The app has a simple user interface that displays <b>one color as background and another as font color of the text<\/b>. By clicking on the double arrow icon between two color codes, it reverses background color as text font and font color as background. <\/p>\n<p>User may select color either by clicking on the circle icon before hex code (e.g., <i>#F3F6F9<\/i>), or by using the color picker tool after the code.<\/p>\n<div id=\"attachment_35842\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-customcolor.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-35842\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-customcolor-600x386.jpg\" alt=\"\" width=\"600\" height=\"386\" class=\"size-large wp-image-35842\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-customcolor-600x386.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-customcolor-300x193.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-customcolor-768x494.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-customcolor.jpg 840w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-35842\" class=\"wp-caption-text\">Contrast Select Color<\/p><\/div>\n<p>The app will display color contrast result with text, such as &#8220;<i>Awesome<\/i>, <i>Pretty Good<\/i>, <i>Not Bad<\/i>, and <i>Nope<\/i>, along with short description tells whether the color combination will properly work. <\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-reverse.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-reverse.png\" alt=\"\" width=\"547\" height=\"372\" class=\"aligncenter size-full wp-image-35843\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-reverse.png 547w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-reverse-300x204.png 300w\" sizes=\"auto, (max-width: 547px) 100vw, 547px\" \/><\/a><\/p>\n<p>It also displays a score bar tells that if the color contrast meets the 3 <a href=\"https:\/\/www.w3.org\/WAI\/WCAG21\/Understanding\/conformance\" rel=\"noopener\" target=\"_blank\">WCAG Levels: A, AA and AAA<\/a>. And, a contrast ratio is displayed at the bottom.<\/p>\n<div id=\"attachment_35844\" style=\"width: 557px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-app.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-35844\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-app.png\" alt=\"\" width=\"547\" height=\"372\" class=\"size-full wp-image-35844\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-app.png 547w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/contrast-app-300x204.png 300w\" sizes=\"auto, (max-width: 547px) 100vw, 547px\" \/><\/a><p id=\"caption-attachment-35844\" class=\"wp-caption-text\">Reversed colors<\/p><\/div>\n<h3>How to Install Contrast in Ubuntu Linux:<\/h3>\n<p>As a GTK4 app, Contrast so far only available to install as <a href=\"https:\/\/flathub.org\/apps\/details\/org.gnome.design.Contrast\" rel=\"noopener\" target=\"_blank\">Flatpak<\/a> which runs in sandbox. <\/p>\n<p>1. Firstly, press <b>Ctrl+Alt+T<\/b> on keyboard and open terminal. When it opens, run command to install the Flatpak daemon:<\/p>\n<pre>sudo apt install flatpak<\/pre>\n<p>For Ubuntu 18.04 and Ubuntu 16.04, the <a href=\"https:\/\/launchpad.net\/~flatpak\/+archive\/ubuntu\/stable\" rel=\"noopener\" target=\"_blank\">flatpak PPA<\/a> is required to get the package.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/06\/apt-flatpak.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/06\/apt-flatpak-600x102.jpg\" alt=\"\" width=\"600\" height=\"102\" class=\"aligncenter size-large wp-image-10296\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/06\/apt-flatpak-600x102.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/06\/apt-flatpak-450x77.jpg 450w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/06\/apt-flatpak.jpg 705w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>2. Next, run command to install the WCAG color contrast app:<\/p>\n<pre>flatpak install https:\/\/dl.flathub.org\/repo\/appstream\/org.gnome.design.Contrast.flatpakref<\/pre>\n<p>Note: If you&#8217;re first time installing a Gnome app as Flatpak, it will install the required GNOME 41 platform as shared runtime libraries, which take hundreds of megabytes disk space.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/flatpak-contrast.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/flatpak-contrast.png\" alt=\"\" width=\"600\" height=\"252\" class=\"aligncenter size-full wp-image-35845\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/flatpak-contrast.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/11\/flatpak-contrast-300x126.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Once installed, search for and open the app from activities overview screen. <\/p>\n<h3>How to Remove Contrast Flatpak app:<\/h3>\n<p>To remove the software package, press Ctrl+Alt+T and run command in terminal:<\/p>\n<pre>flatpak uninstall --delete-data org.gnome.design.Contrast<\/pre>\n<p>And use <code>flatpak uninstall --unused<\/code> command may remove useless run-times if any.<\/p>","protected":false},"excerpt":{"rendered":"<p>Designers and website developers may sometimes need to check WCAG color contrast to make web content more accessible to people with disabilities. Without using an online website each time, Linux has a stylish GTK4 app &#8220;Contrast&#8221; which allows to check whether the contrast between two colors meet the WCAG requirements. The app has a simple [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":35841,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[2055],"class_list":["post-35840","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-wcag-color-contrast-linux"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/35840","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=35840"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/35840\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/35841"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=35840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=35840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=35840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}