{"id":1539,"date":"2025-03-17T11:45:09","date_gmt":"2025-03-17T11:45:09","guid":{"rendered":"https:\/\/emojifaces.org\/blog\/?p=1539"},"modified":"2025-03-17T11:58:19","modified_gmt":"2025-03-17T11:58:19","slug":"resolved-draw-rectangle-set-border-width-and-fill-with-color","status":"publish","type":"post","link":"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/","title":{"rendered":"[RESOLVED] Draw rectangle, set border width and fill with color"},"content":{"rendered":"<p>Drawing a rectangle, setting its border width, and filling it with color is a fundamental aspect of graphics programming. Whether you are working with <i>HTML5 Canvas<\/i>, <i>SVG<\/i>, or <i>CSS<\/i>, understanding how to achieve this effect will help you create visually appealing designs and user interfaces. In this article, we will explore different ways to draw a rectangle, customize its appearance, and use colors effectively.<\/p>\n<h2>Using HTML5 Canvas<\/h2>\n<p>The HTML5 <code>&lt;canvas&gt;<\/code> element provides a powerful way to create 2D graphics using JavaScript. To draw a rectangle and style it properly, follow these steps:<\/p>\n<ol>\n<li>Create a <code>&lt;canvas&gt;<\/code> element in your HTML.<\/li>\n<li>Access the canvas using JavaScript and obtain the drawing context.<\/li>\n<li>Draw your rectangle using the <code>fillRect()<\/code> method.<\/li>\n<li>Set the border width and stroke color using <code>lineWidth<\/code> and <code>strokeStyle<\/code>.<\/li>\n<li>Use the <code>fillStyle<\/code> property to define the fill color.<\/li>\n<\/ol>\n<p>Here\u2019s a simple example:<\/p>\n<pre><code>\n&lt;canvas id=\"myCanvas\" width=\"200\" height=\"150\"&gt;&lt;\/canvas&gt;\n&lt;script&gt;\n  var canvas = document.getElementById(\"myCanvas\");\n  var ctx = canvas.getContext(\"2d\");\n\n  \/\/ Set fill color\n  ctx.fillStyle = \"lightblue\";\n  ctx.fillRect(20, 20, 150, 100);\n\n  \/\/ Set border width and color\n  ctx.lineWidth = 5;\n  ctx.strokeStyle = \"black\";\n  ctx.strokeRect(20, 20, 150, 100);\n&lt;\/script&gt;\n<\/code><\/pre>\n<p>This will create a light blue rectangle with a black border that is 5 pixels wide.<\/p>\n<img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"608\" src=\"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/a-picture-of-a-white-square-with-a-pink-border-html5-canvas-rectangle-border-color.jpg\" class=\"attachment-full size-full\" alt=\"\" srcset=\"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/a-picture-of-a-white-square-with-a-pink-border-html5-canvas-rectangle-border-color.jpg 1080w, https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/a-picture-of-a-white-square-with-a-pink-border-html5-canvas-rectangle-border-color-300x169.jpg 300w, https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/a-picture-of-a-white-square-with-a-pink-border-html5-canvas-rectangle-border-color-1024x576.jpg 1024w, https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/a-picture-of-a-white-square-with-a-pink-border-html5-canvas-rectangle-border-color-768x432.jpg 768w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/>\n<h2>Using SVG<\/h2>\n<p>SVG (Scalable Vector Graphics) is another way to create rectangles in web design. It allows for high-quality rendering without losing resolution. Here\u2019s how you can create an SVG rectangle:<\/p>\n<pre><code>\n&lt;svg width=\"200\" height=\"150\"&gt;\n  &lt;rect x=\"20\" y=\"20\" width=\"150\" height=\"100\" \n        fill=\"lightblue\" stroke=\"black\" stroke-width=\"5\"\/&gt;\n&lt;\/svg&gt;\n<\/code><\/pre>\n<p>In this example:<\/p>\n<ul>\n<li><code>x<\/code> and <code>y<\/code> define the rectangle\u2019s position.<\/li>\n<li><code>width<\/code> and <code>height<\/code> determine its dimensions.<\/li>\n<li><code>fill<\/code> sets the fill color.<\/li>\n<li><code>stroke<\/code> and <code>stroke-width<\/code> define the border color and width.<\/li>\n<\/ul>\n<img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"1620\" src=\"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/multicolored-hallway-svg-rectangle-color-border.jpg\" class=\"attachment-full size-full\" alt=\"\" srcset=\"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/multicolored-hallway-svg-rectangle-color-border.jpg 1080w, https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/multicolored-hallway-svg-rectangle-color-border-200x300.jpg 200w, https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/multicolored-hallway-svg-rectangle-color-border-683x1024.jpg 683w, https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/multicolored-hallway-svg-rectangle-color-border-768x1152.jpg 768w, https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/multicolored-hallway-svg-rectangle-color-border-1024x1536.jpg 1024w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/>\n<h2>Using CSS<\/h2>\n<p>For simple rectangles with background colors and border styling, CSS is a great option. You can use the <code>&lt;div&gt;<\/code> element and apply styles:<\/p>\n<pre><code>\n&lt;div class=\"rectangle\"&gt;&lt;\/div&gt;\n\n&lt;style&gt;\n  .rectangle {\n    width: 150px;\n    height: 100px;\n    background-color: lightblue;\n    border: 5px solid black;\n  }\n&lt;\/style&gt;\n<\/code><\/pre>\n<p>With CSS, you can also apply additional styles such as rounded corners, shadows, and animations to make your rectangles more visually appealing.<\/p>\n<h2>Choosing the Right Method<\/h2>\n<p>The method you choose depends on your needs:<\/p>\n<ul>\n<li>Use <b>HTML5 Canvas<\/b> if you need dynamic drawing with JavaScript.<\/li>\n<li>Use <b>SVG<\/b> if you require scalable graphics with vector support.<\/li>\n<li>Use <b>CSS<\/b> for simple design elements without extra JavaScript.<\/li>\n<\/ul>\n<img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"1620\" src=\"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/abstract-painting-css-rectangle-border-fill-color.jpg\" class=\"attachment-full size-full\" alt=\"\" srcset=\"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/abstract-painting-css-rectangle-border-fill-color.jpg 1080w, https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/abstract-painting-css-rectangle-border-fill-color-200x300.jpg 200w, https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/abstract-painting-css-rectangle-border-fill-color-683x1024.jpg 683w, https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/abstract-painting-css-rectangle-border-fill-color-768x1152.jpg 768w, https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/abstract-painting-css-rectangle-border-fill-color-1024x1536.jpg 1024w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/>\n<h2>Conclusion<\/h2>\n<p>Drawing rectangles, setting borders, and filling them with color is an essential skill in web design and graphics programming. Whether you&#8217;re using HTML5 Canvas, SVG, or CSS, understanding how to manipulate these properties correctly will help you create stunning visuals in your projects.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Drawing a rectangle, setting its border width, and filling it with color is a fundamental aspect of graphics programming. Whether &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"[RESOLVED] Draw rectangle, set border width and fill with color\" class=\"read-more button\" href=\"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/#more-1539\" aria-label=\"Read more about [RESOLVED] Draw rectangle, set border width and fill with color\">Read more<\/a><\/p>\n","protected":false},"author":39,"featured_media":1540,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[485],"tags":[],"class_list":["post-1539","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","resize-featured-image"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[RESOLVED] Draw rectangle, set border width and fill with color - EmojiFaces Blog \ud83d\ude0e<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[RESOLVED] Draw rectangle, set border width and fill with color - EmojiFaces Blog \ud83d\ude0e\" \/>\n<meta property=\"og:description\" content=\"Drawing a rectangle, setting its border width, and filling it with color is a fundamental aspect of graphics programming. Whether ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/\" \/>\n<meta property=\"og:site_name\" content=\"EmojiFaces Blog \ud83d\ude0e\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-17T11:45:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-17T11:58:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/multicolored-hallway-html5-canvas-rectangle-border-color.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1080\" \/>\n\t<meta property=\"og:image:height\" content=\"1620\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jame Miller\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jame Miller\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/\"},\"author\":{\"name\":\"Jame Miller\",\"@id\":\"https:\/\/emojifaces.org\/blog\/#\/schema\/person\/a0f9a21c48eb810387960779e71189a6\"},\"headline\":\"[RESOLVED] Draw rectangle, set border width and fill with color\",\"datePublished\":\"2025-03-17T11:45:09+00:00\",\"dateModified\":\"2025-03-17T11:58:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/\"},\"wordCount\":367,\"publisher\":{\"@id\":\"https:\/\/emojifaces.org\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/multicolored-hallway-html5-canvas-rectangle-border-color.jpg\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/\",\"url\":\"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/\",\"name\":\"[RESOLVED] Draw rectangle, set border width and fill with color - EmojiFaces Blog \ud83d\ude0e\",\"isPartOf\":{\"@id\":\"https:\/\/emojifaces.org\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/multicolored-hallway-html5-canvas-rectangle-border-color.jpg\",\"datePublished\":\"2025-03-17T11:45:09+00:00\",\"dateModified\":\"2025-03-17T11:58:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/#primaryimage\",\"url\":\"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/multicolored-hallway-html5-canvas-rectangle-border-color.jpg\",\"contentUrl\":\"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/multicolored-hallway-html5-canvas-rectangle-border-color.jpg\",\"width\":1080,\"height\":1620},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/emojifaces.org\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[RESOLVED] Draw rectangle, set border width and fill with color\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/emojifaces.org\/blog\/#website\",\"url\":\"https:\/\/emojifaces.org\/blog\/\",\"name\":\"EmojiFaces Blog \ud83d\ude0e\",\"description\":\"Simple Emoji Keyboard to Copy &amp; Paste\",\"publisher\":{\"@id\":\"https:\/\/emojifaces.org\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/emojifaces.org\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/emojifaces.org\/blog\/#organization\",\"name\":\"EmojiFaces Blog \ud83d\ude0e\",\"url\":\"https:\/\/emojifaces.org\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/emojifaces.org\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2022\/07\/cropped-emojifaces-logo.png\",\"contentUrl\":\"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2022\/07\/cropped-emojifaces-logo.png\",\"width\":312,\"height\":63,\"caption\":\"EmojiFaces Blog \ud83d\ude0e\"},\"image\":{\"@id\":\"https:\/\/emojifaces.org\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/emojifaces.org\/blog\/#\/schema\/person\/a0f9a21c48eb810387960779e71189a6\",\"name\":\"Jame Miller\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/emojifaces.org\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/906d8a8fa6c3e14384c5577430fce80ea6f816e5fc083e2bc39ab04d01d06283?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/906d8a8fa6c3e14384c5577430fce80ea6f816e5fc083e2bc39ab04d01d06283?s=96&d=mm&r=g\",\"caption\":\"Jame Miller\"},\"description\":\"I'm Jame Miller, a cybersecurity analyst and blogger. Sharing knowledge on online security, data protection, and privacy issues is what I do best.\",\"url\":\"https:\/\/emojifaces.org\/blog\/author\/jamesm\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[RESOLVED] Draw rectangle, set border width and fill with color - EmojiFaces Blog \ud83d\ude0e","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/","og_locale":"en_US","og_type":"article","og_title":"[RESOLVED] Draw rectangle, set border width and fill with color - EmojiFaces Blog \ud83d\ude0e","og_description":"Drawing a rectangle, setting its border width, and filling it with color is a fundamental aspect of graphics programming. Whether ... Read more","og_url":"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/","og_site_name":"EmojiFaces Blog \ud83d\ude0e","article_published_time":"2025-03-17T11:45:09+00:00","article_modified_time":"2025-03-17T11:58:19+00:00","og_image":[{"width":1080,"height":1620,"url":"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/multicolored-hallway-html5-canvas-rectangle-border-color.jpg","type":"image\/jpeg"}],"author":"Jame Miller","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jame Miller","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/#article","isPartOf":{"@id":"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/"},"author":{"name":"Jame Miller","@id":"https:\/\/emojifaces.org\/blog\/#\/schema\/person\/a0f9a21c48eb810387960779e71189a6"},"headline":"[RESOLVED] Draw rectangle, set border width and fill with color","datePublished":"2025-03-17T11:45:09+00:00","dateModified":"2025-03-17T11:58:19+00:00","mainEntityOfPage":{"@id":"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/"},"wordCount":367,"publisher":{"@id":"https:\/\/emojifaces.org\/blog\/#organization"},"image":{"@id":"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/#primaryimage"},"thumbnailUrl":"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/multicolored-hallway-html5-canvas-rectangle-border-color.jpg","articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/","url":"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/","name":"[RESOLVED] Draw rectangle, set border width and fill with color - EmojiFaces Blog \ud83d\ude0e","isPartOf":{"@id":"https:\/\/emojifaces.org\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/#primaryimage"},"image":{"@id":"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/#primaryimage"},"thumbnailUrl":"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/multicolored-hallway-html5-canvas-rectangle-border-color.jpg","datePublished":"2025-03-17T11:45:09+00:00","dateModified":"2025-03-17T11:58:19+00:00","breadcrumb":{"@id":"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/#primaryimage","url":"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/multicolored-hallway-html5-canvas-rectangle-border-color.jpg","contentUrl":"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2025\/03\/multicolored-hallway-html5-canvas-rectangle-border-color.jpg","width":1080,"height":1620},{"@type":"BreadcrumbList","@id":"https:\/\/emojifaces.org\/blog\/2025\/03\/17\/resolved-draw-rectangle-set-border-width-and-fill-with-color\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/emojifaces.org\/blog\/"},{"@type":"ListItem","position":2,"name":"[RESOLVED] Draw rectangle, set border width and fill with color"}]},{"@type":"WebSite","@id":"https:\/\/emojifaces.org\/blog\/#website","url":"https:\/\/emojifaces.org\/blog\/","name":"EmojiFaces Blog \ud83d\ude0e","description":"Simple Emoji Keyboard to Copy &amp; Paste","publisher":{"@id":"https:\/\/emojifaces.org\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/emojifaces.org\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/emojifaces.org\/blog\/#organization","name":"EmojiFaces Blog \ud83d\ude0e","url":"https:\/\/emojifaces.org\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/emojifaces.org\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2022\/07\/cropped-emojifaces-logo.png","contentUrl":"https:\/\/emojifaces.org\/blog\/wp-content\/uploads\/2022\/07\/cropped-emojifaces-logo.png","width":312,"height":63,"caption":"EmojiFaces Blog \ud83d\ude0e"},"image":{"@id":"https:\/\/emojifaces.org\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/emojifaces.org\/blog\/#\/schema\/person\/a0f9a21c48eb810387960779e71189a6","name":"Jame Miller","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/emojifaces.org\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/906d8a8fa6c3e14384c5577430fce80ea6f816e5fc083e2bc39ab04d01d06283?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/906d8a8fa6c3e14384c5577430fce80ea6f816e5fc083e2bc39ab04d01d06283?s=96&d=mm&r=g","caption":"Jame Miller"},"description":"I'm Jame Miller, a cybersecurity analyst and blogger. Sharing knowledge on online security, data protection, and privacy issues is what I do best.","url":"https:\/\/emojifaces.org\/blog\/author\/jamesm\/"}]}},"_links":{"self":[{"href":"https:\/\/emojifaces.org\/blog\/wp-json\/wp\/v2\/posts\/1539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emojifaces.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emojifaces.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emojifaces.org\/blog\/wp-json\/wp\/v2\/users\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/emojifaces.org\/blog\/wp-json\/wp\/v2\/comments?post=1539"}],"version-history":[{"count":1,"href":"https:\/\/emojifaces.org\/blog\/wp-json\/wp\/v2\/posts\/1539\/revisions"}],"predecessor-version":[{"id":1547,"href":"https:\/\/emojifaces.org\/blog\/wp-json\/wp\/v2\/posts\/1539\/revisions\/1547"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/emojifaces.org\/blog\/wp-json\/wp\/v2\/media\/1540"}],"wp:attachment":[{"href":"https:\/\/emojifaces.org\/blog\/wp-json\/wp\/v2\/media?parent=1539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emojifaces.org\/blog\/wp-json\/wp\/v2\/categories?post=1539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emojifaces.org\/blog\/wp-json\/wp\/v2\/tags?post=1539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}