<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Someesim</title>
    <description>The latest articles on DEV Community by Someesim (@someesim).</description>
    <link>https://dev.to/someesim</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4189283%2F938b6d94-d7f1-4ddc-ad19-587941860bae.png</url>
      <title>DEV Community: Someesim</title>
      <link>https://dev.to/someesim</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/someesim"/>
    <language>en</language>
    <item>
      <title>Eliminating Sub-Millimeter Drift When Printing Barcode Label Grids from the Browser</title>
      <dc:creator>Someesim</dc:creator>
      <pubDate>Tue, 10 Nov 2026 00:13:53 +0000</pubDate>
      <link>https://dev.to/someesim/eliminating-sub-millimeter-drift-when-printing-barcode-label-grids-from-the-browser-4e9c</link>
      <guid>https://dev.to/someesim/eliminating-sub-millimeter-drift-when-printing-barcode-label-grids-from-the-browser-4e9c</guid>
      <description>&lt;p&gt;Anyone who has built an HTML/CSS sheet-label generator for 30-up Avery 5160 sheets or 4×6 direct-thermal shipping labels eventually hits vertical creep: row 1 aligns inside the die-cut border, while row 10 clips 3 millimeters below the perforation.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Why CSS Pixels Drift Across Operating Systems
&lt;/h2&gt;

&lt;p&gt;Browser print engines rasterize or paginate DOM layouts through CSS reference pixels (&lt;code&gt;1in = 96px&lt;/code&gt;) before handing the spool to the OS print dialog. Two silent mutations commonly ruin physical pitch accuracy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fit-to-Page Auto-Scaling&lt;/strong&gt;: Chrome and Edge shrink printable boxes by 94%–97% whenever unprintable printer hardware margins intersect the CSS &lt;code&gt;@page&lt;/code&gt; box.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sub-Pixel Rounding Accumulation&lt;/strong&gt;: An Avery 5160 cell is &lt;code&gt;2.625 in × 1.0 in&lt;/code&gt; with a horizontal pitch of &lt;code&gt;2.75 in&lt;/code&gt;. Rounding fractional CSS flex/grid tracks over 10 rows accumulates enough vertical error to cross the die-cut line.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Computing Directly in PostScript Vector Points (72 pt = 1 inch)
&lt;/h2&gt;

&lt;p&gt;Generating native PDF streams client-side in WebAssembly/JavaScript bypasses DOM layout rounding completely. In the PDF coordinate system (origin at bottom-left), physical measurements convert deterministically:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;INCH_TO_PT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;72&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;MM_TO_PT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;72&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;25.4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Avery 5160 exact geometry on US Letter (612 x 792 pt)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;topMarginPt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;INCH_TO_PT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;     &lt;span class="c1"&gt;// 36 pt&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;leftMarginPt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.1875&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;INCH_TO_PT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// 13.5 pt&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;colPitchPt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;2.75&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;INCH_TO_PT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;     &lt;span class="c1"&gt;// 198 pt&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;rowPitchPt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;INCH_TO_PT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;      &lt;span class="c1"&gt;// 72 pt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Crisp Code 128 &amp;amp; EAN-13 Quiet Zones on 203 DPI Thermal Heads
&lt;/h2&gt;

&lt;p&gt;Direct thermal printers (Zebra, Rollo, Dymo) print at &lt;code&gt;203 DPI&lt;/code&gt; (&lt;code&gt;8 dots/mm&lt;/code&gt;). Rendering a barcode into a PNG canvas first introduces anti-aliased gray edge pixels that thermal printheads dither, causing handheld laser scanners to reject narrow bars. Emitting each Code 128 module as an unstroked filled PDF vector rectangle guarantees sharp 1-bit bar boundaries at any DPI.&lt;/p&gt;

&lt;p&gt;For client-side CSV-to-PDF batch generation with zero cloud uploads, see the &lt;a href="https://labelqueue.com/excel-to-labels" rel="noopener noreferrer"&gt;CSV and Excel barcode sheet builder&lt;/a&gt; on &lt;a href="https://labelqueue.com" rel="noopener noreferrer"&gt;LabelQueue&lt;/a&gt;, or query exact template pitches programmatically via &lt;code&gt;npx labelqueue-cli demo&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>css</category>
      <category>frontend</category>
      <category>html</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Why sRGB Euclidean Distance Fails on Paint Swatches (And How CIEDE2000 Fixes It)</title>
      <dc:creator>Someesim</dc:creator>
      <pubDate>Tue, 10 Nov 2026 00:10:38 +0000</pubDate>
      <link>https://dev.to/someesim/why-srgb-euclidean-distance-fails-on-paint-swatches-and-how-ciede2000-fixes-it-29hc</link>
      <guid>https://dev.to/someesim/why-srgb-euclidean-distance-fails-on-paint-swatches-and-how-ciede2000-fixes-it-29hc</guid>
      <description>&lt;p&gt;If you sample a wall color from a room photograph—say &lt;code&gt;#DCE3E6&lt;/code&gt;—and search a database of 15,000 commercial paint swatches using standard RGB Euclidean distance, the top result frequently looks visibly purple or green once rolled onto drywall.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Non-Linearity of sRGB Gamma Encoding
&lt;/h2&gt;

&lt;p&gt;Standard hex codes live in gamma-compressed sRGB space rather than linear light intensity. Before comparing two colors, each channel &lt;code&gt;C_srgb&lt;/code&gt; in &lt;code&gt;[0, 1]&lt;/code&gt; must be linearized:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;linearize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mf"&gt;0.04045&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;12.92&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.055&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;1.055&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;2.4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once linearized, the relative luminance &lt;code&gt;Y = 0.2126 * R + 0.7152 * G + 0.0722 * B&lt;/code&gt; maps directly to the paint industry's &lt;strong&gt;Light Reflectance Value (LRV, 0–100)&lt;/strong&gt; printed on the back of fan decks from Sherwin-Williams, Benjamin Moore, and Behr.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Perceptual Uniformity and the Blue-Hue Twist
&lt;/h2&gt;

&lt;p&gt;Even after converting linear RGB to CIE XYZ (D65 illuminant) and CIE &lt;code&gt;L*a*b*&lt;/code&gt;, simple Euclidean distance (&lt;code&gt;CIE76&lt;/code&gt;) over-penalizes saturated yellows and under-penalizes subtle hue shifts in low-chroma grays—the exact region where 70% of architectural interior paints sit.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;CIEDE2000 (&lt;code&gt;ΔE00&lt;/code&gt;)&lt;/strong&gt; formula introduces three perceptual corrections essential for cross-brand swatch matching:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Lightness, Chroma, and Hue Weighting Functions (&lt;code&gt;S_L&lt;/code&gt;, &lt;code&gt;S_C&lt;/code&gt;, &lt;code&gt;S_H&lt;/code&gt;)&lt;/strong&gt; that compress tolerance ellipses near neutral grays so warm greige never collides with cool slate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;G-Factor Expansion on the &lt;code&gt;a*&lt;/code&gt; Axis&lt;/strong&gt; to sharpen red-green sensitivity on subtle off-whites.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rotation Term (&lt;code&gt;R_T&lt;/code&gt;) in the 275° Blue Region&lt;/strong&gt; correcting the well-known CIE Lab curvature where navy blues drift toward violet.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Practical Thresholds for Cross-Brand Paint Equivalents
&lt;/h2&gt;

&lt;p&gt;When matching across proprietary fan decks—for example, finding the closest Benjamin Moore or Behr swatch to a Sherwin-Williams specification—&lt;code&gt;ΔE00&lt;/code&gt; values map reliably to human perception under D65 daylight:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ΔE00 &amp;lt; 1.0&lt;/code&gt;: Imperceptible difference on adjacent walls.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;1.0 ≤ ΔE00 ≤ 2.0&lt;/code&gt;: Close cross-brand match suitable for trim/wall pairings when sheen is matched.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ΔE00 &amp;gt; 2.5&lt;/code&gt;: Noticeable undertone shift under 2700K warm LED lighting.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can inspect live &lt;code&gt;ΔE00&lt;/code&gt; distances, LRV values, and cross-brand equivalents directly with the &lt;a href="https://paintcolormatcher.com/hex-to-paint-color" rel="noopener noreferrer"&gt;HEX to paint swatch converter&lt;/a&gt; at &lt;a href="https://paintcolormatcher.com" rel="noopener noreferrer"&gt;PaintColorMatcher&lt;/a&gt;, or query its stateless JSON-RPC endpoint (&lt;code&gt;https://paintcolormatcher.com/api/mcp&lt;/code&gt;) from terminal workflows.&lt;/p&gt;

</description>
      <category>design</category>
      <category>javascript</category>
      <category>softwareengineering</category>
    </item>
  </channel>
</rss>
