{"id":1209,"date":"2024-07-31T12:08:13","date_gmt":"2024-07-31T10:08:13","guid":{"rendered":"https:\/\/blog.sutilweb.eu\/?page_id=1209"},"modified":"2024-07-31T12:08:13","modified_gmt":"2024-07-31T10:08:13","slug":"08-colores-css-hex","status":"publish","type":"page","link":"https:\/\/sutilweb.eu\/index.php\/lenguajes\/css3\/css3-basico\/08-colores-css-hex\/","title":{"rendered":"08. Colores CSS HEX"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Un <strong>color hexadecimal<\/strong> se especifica con: #RRGGBB, donde los enteros hexadecimales RR (rojo), GG (verde) y BB (azul) especifican los componentes del color. En <strong>CSS<\/strong>, se puede especificar un color usando un <strong>valor hexadecimal<\/strong> en la forma:<\/p>\n\n\n\n<!--more-->\n\n\n\n<pre class=\"wp-block-preformatted\">#<em>rrggbb<\/em><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Donde <strong><em>rr<\/em> <\/strong>(rojo), <strong><em>gg<\/em> <\/strong>(verde) y <strong><em>bb<\/em> <\/strong>(azul) son valores hexadecimales entre <strong><em>00<\/em> <\/strong>y <strong><em>ff<\/em> <\/strong>(igual que decimal 0-255). Por ejemplo, #<strong><em>ff0000<\/em> <\/strong>se muestra en rojo, porque el rojo se establece en su valor m\u00e1s alto (<strong><em>ff<\/em><\/strong>) y los dem\u00e1s se establecen en el valor m\u00e1s bajo (<strong><em>00<\/em><\/strong>). Para mostrar negro, establezca todos los valores en 00, as\u00ed: #<strong><em>000000<\/em><\/strong>. Para mostrar blanco, establezca todos los valores en <strong><em>ff<\/em><\/strong>, as\u00ed: #<strong><em>ffffff<\/em><\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Tonos de grises<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Los tonos de gris a menudo se definen utilizando valores iguales para las 3 fuentes de luz.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Ejm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;body&gt;\n\n&lt;h1&gt;Shades of gray&lt;\/h1&gt;\n\n&lt;p&gt;By using equal values for red, green, and blue, you will get \ndifferent shades of gray:&lt;\/p&gt;\n\n&lt;h2 style=\"background-color:#3c3c3c;\"&gt;#3c3c3c&lt;\/h2&gt;\n&lt;h2 style=\"background-color:#616161;\"&gt;#616161&lt;\/h2&gt;\n&lt;h2 style=\"background-color:#787878;\"&gt;#787878&lt;\/h2&gt;\n&lt;h2 style=\"background-color:#b4b4b4;\"&gt;#b4b4b4&lt;\/h2&gt;\n&lt;h2 style=\"background-color:#f0f0f0;\"&gt;#f0f0f0&lt;\/h2&gt;\n&lt;h2 style=\"background-color:#f9f9f9;\"&gt;#f9f9f9&lt;\/h2&gt;\n\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">C\u00f3digo hexadecimal de 3 d\u00edgitos<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A veces ver\u00e1 un <strong>c\u00f3digo hexadecimal<\/strong> de 3 d\u00edgitos en la fuente CSS. El <strong>c\u00f3digo hexadecimal<\/strong> de 3 d\u00edgitos es una forma abreviada de algunos c\u00f3digos hexadecimales de 6 d\u00edgitos. El c\u00f3digo hexadecimal de 3 d\u00edgitos tiene la siguiente forma:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#<em>rgb<\/em><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Donde <strong><em>r<\/em><\/strong>, <strong><em>g<\/em><\/strong> y <strong><em>b<\/em><\/strong> representan los componentes rojo, verde y azul con valores entre <strong><em>0<\/em><\/strong> y <strong><em>f<\/em><\/strong>. El c\u00f3digo hexadecimal de 3 d\u00edgitos solo se puede usar cuando ambos valores (<strong><em>RR<\/em><\/strong>, <strong><em>GG<\/em> <\/strong>y <strong><em>BB<\/em><\/strong>) son iguales para cada componente. Entonces, si tenemos #<strong><em>ff00cc<\/em><\/strong>, se puede escribir as\u00ed: #<strong><em>f0c<\/em><\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Ejm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">body&nbsp;{\n&nbsp; background-color:&nbsp;#fc9;&nbsp;\/* same as #ffcc99 *\/\n}\n\nh1&nbsp;{\n&nbsp; color:&nbsp;#f0f;&nbsp;\/* same as #ff00ff *\/\n}\n\np&nbsp;{\n&nbsp; color:&nbsp;#b58;&nbsp;\/* same as #bb5588 *\/\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Un color hexadecimal se especifica con: #RRGGBB, donde los enteros hexadecimales RR (rojo), GG (verde) y BB (azul) especifican los [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":563,"menu_order":7,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-1209","page","type-page","status-publish","hentry"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Sutil Web","author_link":"https:\/\/sutilweb.eu\/index.php\/author\/sutilweb\/"},"uagb_comment_info":0,"uagb_excerpt":"Un color hexadecimal se especifica con: #RRGGBB, donde los enteros hexadecimales RR (rojo), GG (verde) y BB (azul) especifican los [&hellip;]","_links":{"self":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/comments?post=1209"}],"version-history":[{"count":1,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1209\/revisions"}],"predecessor-version":[{"id":1210,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1209\/revisions\/1210"}],"up":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/563"}],"wp:attachment":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/media?parent=1209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}