{"id":4994,"date":"2019-09-02T09:00:20","date_gmt":"2019-09-02T07:00:20","guid":{"rendered":"https:\/\/blogs.ua.es\/pi\/?p=4994"},"modified":"2020-06-10T18:24:10","modified_gmt":"2020-06-10T16:24:10","slug":"como-manipular-los-colores-css-con-javascript","status":"publish","type":"post","link":"https:\/\/blogs.ua.es\/pi\/2019\/09\/02\/como-manipular-los-colores-css-con-javascript\/","title":{"rendered":"C\u00f3mo manipular los colores CSS con JavaScript"},"content":{"rendered":"<p>Un excelente art\u00edculo <a href=\"https:\/\/blog.logrocket.com\/how-to-manipulate-css-colors-with-javascript-fb547113a1b8\/\">How to manipulate CSS colors with JavaScript<\/a>:<\/p>\n<blockquote><p>I know you\u2019re here to learn about manipulating colors\u200a\u2014\u200aand we\u2019ll get there. But before we do, we need a baseline understanding of how CSS notates colors. CSS uses two different color models: RGB and HSL.<\/p>\n<p>Both the RGB and HSL color models break down a color into various attributes. To convert between the syntaxes, we first need to calculate these attributes.<\/p>\n<p>With the exception of hue, each value we have discussed can be represented as a percentage. Even the RGB values are byte-sized representations of percentages. In the formulas and functions below, these percentages will be represented by decimals between 0 and 1.<\/p>\n<p>I would like to note that I will not cover the math for these in depth; rather, I will briefly go over the original mathematical formula and then convert it into a JavaScript formula.<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Un excelente art\u00edculo How to manipulate CSS colors with JavaScript: I know you\u2019re here to learn about manipulating colors\u200a\u2014\u200aand we\u2019ll get there. But before we do, we need a baseline understanding of how CSS notates colors. CSS uses two different &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/blogs.ua.es\/pi\/2019\/09\/02\/como-manipular-los-colores-css-con-javascript\/\"> <span class=\"screen-reader-text\">C\u00f3mo manipular los colores CSS con JavaScript<\/span> Leer M\u00e1s  &raquo;<\/a><\/p>\n","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[2765,4803],"class_list":["post-4994","post","type-post","status-publish","format-standard","hentry","category-general","tag-css","tag-javascript"],"_links":{"self":[{"href":"https:\/\/blogs.ua.es\/pi\/wp-json\/wp\/v2\/posts\/4994","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.ua.es\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.ua.es\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.ua.es\/pi\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.ua.es\/pi\/wp-json\/wp\/v2\/comments?post=4994"}],"version-history":[{"count":1,"href":"https:\/\/blogs.ua.es\/pi\/wp-json\/wp\/v2\/posts\/4994\/revisions"}],"predecessor-version":[{"id":4995,"href":"https:\/\/blogs.ua.es\/pi\/wp-json\/wp\/v2\/posts\/4994\/revisions\/4995"}],"wp:attachment":[{"href":"https:\/\/blogs.ua.es\/pi\/wp-json\/wp\/v2\/media?parent=4994"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.ua.es\/pi\/wp-json\/wp\/v2\/categories?post=4994"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.ua.es\/pi\/wp-json\/wp\/v2\/tags?post=4994"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}