<?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: xiangqian yao</title>
    <description>The latest articles on DEV Community by xiangqian yao (@xiangqian_yao_0f2a6a9842a).</description>
    <link>https://dev.to/xiangqian_yao_0f2a6a9842a</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%2F4239630%2Fbcdd0a9b-0450-4799-af12-0532e02a02e3.png</url>
      <title>DEV Community: xiangqian yao</title>
      <link>https://dev.to/xiangqian_yao_0f2a6a9842a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xiangqian_yao_0f2a6a9842a"/>
    <language>en</language>
    <item>
      <title>How I keep HEX, RGB, HSL, and WCAG contrast straight (and the free toolkit I built for it)</title>
      <dc:creator>xiangqian yao</dc:creator>
      <pubDate>Wed, 11 Nov 2026 18:29:02 +0000</pubDate>
      <link>https://dev.to/xiangqian_yao_0f2a6a9842a/how-i-keep-hex-rgb-hsl-and-wcag-contrast-straight-and-the-free-toolkit-i-built-for-it-3oah</link>
      <guid>https://dev.to/xiangqian_yao_0f2a6a9842a/how-i-keep-hex-rgb-hsl-and-wcag-contrast-straight-and-the-free-toolkit-i-built-for-it-3oah</guid>
      <description>&lt;h1&gt;
  
  
  How I keep HEX, RGB, HSL, and WCAG contrast straight (and the free toolkit I built for it)
&lt;/h1&gt;

&lt;p&gt;If you design or ship UI, you live in color values. One tab has a picker stuck on HEX. Another has a contrast checker. A third has a palette generator that exports everything except the CSS variables you actually need. I got tired of that loop, so I wrote down the mental model I use — and packaged the tools I reach for into one free static site: &lt;a href="https://hexcolorpro.pages.dev" rel="noopener noreferrer"&gt;HexColor Pro&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This is not a “10 color theory tips” list. It’s the practical subset I use when picking UI colors and checking that text stays readable.&lt;/p&gt;

&lt;h2&gt;
  
  
  HEX, RGB, HSL — when each one helps
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;HEX&lt;/strong&gt; is the web’s default shorthand: &lt;code&gt;#6366f1&lt;/code&gt;. It’s compact, copy-paste friendly, and what most design tokens still speak. Great for storing and sharing. Awkward when you want to “make this 10% lighter” by hand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RGB&lt;/strong&gt; (&lt;code&gt;rgb(99, 102, 241)&lt;/code&gt;) is what the browser composites. Useful when you reason about channels, mix colors, or talk to canvas/WebGL. Still not the friendliest for “a bit less saturated.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HSL&lt;/strong&gt; (&lt;code&gt;hsl(239 84% 67%)&lt;/code&gt;) maps better to how we talk about color: hue, saturation, lightness. When I’m building a shade scale for a design system, I usually think in HSL (or OKLCH if the stack supports it) and convert back to HEX for tokens.&lt;/p&gt;

&lt;p&gt;HSV (and CMYK on print-adjacent work) show up often enough that a converter should support them without a second website. HexColor Pro’s picker and converter expose HEX, RGB, HSL, HSV, and CMYK, including bulk conversion when you’re migrating a token list.&lt;/p&gt;

&lt;h2&gt;
  
  
  Contrast is not optional
&lt;/h2&gt;

&lt;p&gt;Pretty palettes fail in production when body text sits at 2.3:1 on a pastel card. WCAG contrast ratios exist so people can actually read the UI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AA&lt;/strong&gt; normal text: at least &lt;strong&gt;4.5:1&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AA&lt;/strong&gt; large text: at least &lt;strong&gt;3:1&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AAA&lt;/strong&gt; is stricter (7:1 / 4.5:1)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;“Large text” generally means ~18pt+ (or 14pt+ bold), but check the current WCAG definitions for your case. The habit that helped me: &lt;strong&gt;pick the text/background pair first, decorate second.&lt;/strong&gt; Brand gradients look worse when the label on top fails AA.&lt;/p&gt;

&lt;p&gt;HexColor Pro includes a &lt;a href="https://hexcolorpro.pages.dev/contrast-checker" rel="noopener noreferrer"&gt;contrast checker&lt;/a&gt; for AA/AAA and a &lt;a href="https://hexcolorpro.pages.dev/text-color-generator" rel="noopener noreferrer"&gt;text color helper&lt;/a&gt; that suggests a readable foreground for a given background. Use them as a gate before you export a palette.&lt;/p&gt;

&lt;h2&gt;
  
  
  Palettes and gradients that export to CSS
&lt;/h2&gt;

&lt;p&gt;Harmony modes (complementary, analogous, triadic, split complementary, tetradic, monochromatic, shades) are a starting point, not a brand. I generate a candidate set, then kill anything that fails contrast on real components (buttons, links, helper text).&lt;/p&gt;

&lt;p&gt;When a palette is “good enough,” I want &lt;strong&gt;CSS variables or SCSS&lt;/strong&gt; — not only a PNG. The &lt;a href="https://hexcolorpro.pages.dev/palette-generator" rel="noopener noreferrer"&gt;palette generator&lt;/a&gt; is built around that habit. Same for gradients: linear, radial, and conic stops are only useful if you can copy CSS into a stylesheet in one click (&lt;a href="https://hexcolorpro.pages.dev/gradient-generator" rel="noopener noreferrer"&gt;gradient generator&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a static toolkit
&lt;/h2&gt;

&lt;p&gt;HexColor Pro is a static site on &lt;strong&gt;Cloudflare Pages&lt;/strong&gt;. The tools run in the browser: no account, no signup wall, privacy-first, and they keep working offline after the first load. That constraint shaped the product — if a feature needs your email, it doesn’t belong here.&lt;/p&gt;

&lt;p&gt;What’s included today:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Color picker with recent colors and clipboard copy
&lt;/li&gt;
&lt;li&gt;WCAG contrast checker
&lt;/li&gt;
&lt;li&gt;Palette generator with harmony modes and CSS/SCSS export
&lt;/li&gt;
&lt;li&gt;CSS gradient generator (linear / radial / conic)
&lt;/li&gt;
&lt;li&gt;Shades/tints, color mixer, random colors
&lt;/li&gt;
&lt;li&gt;Named-color finder (~1,500 names)
&lt;/li&gt;
&lt;li&gt;Converters (including bulk)
&lt;/li&gt;
&lt;li&gt;Color temperature and text-on-background helpers
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Try it: &lt;a href="https://hexcolorpro.pages.dev" rel="noopener noreferrer"&gt;https://hexcolorpro.pages.dev&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A simple workflow you can steal
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Pick a base brand hue (HEX or HSL).
&lt;/li&gt;
&lt;li&gt;Generate a small palette (primary / neutrals / danger).
&lt;/li&gt;
&lt;li&gt;Run &lt;strong&gt;every&lt;/strong&gt; text style against its background in the contrast checker.
&lt;/li&gt;
&lt;li&gt;Build shade steps for hover/active states.
&lt;/li&gt;
&lt;li&gt;Export CSS variables; only then tweak gradients or decorative accents.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What I’d love feedback on
&lt;/h2&gt;

&lt;p&gt;I’m sharing this as a &lt;code&gt;#showdev&lt;/code&gt; project, not a pitch deck. If you try the site, tell me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which tools you actually used vs skipped
&lt;/li&gt;
&lt;li&gt;Whether the homepage makes the purpose obvious
&lt;/li&gt;
&lt;li&gt;Formats or exports you’d add (Tailwind tokens, OKLCH, etc.)
&lt;/li&gt;
&lt;li&gt;Mobile UX pain&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks for reading — and if you only take one thing away, make it this: &lt;strong&gt;choose readable pairs before you fall in love with a palette.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>webdev</category>
      <category>css</category>
      <category>design</category>
    </item>
  </channel>
</rss>
