Paste hex color from CSS (with or without # prefix)
Tool converts each component to decimal RGB
Copy RGB values into Canvas/WebGL code
CSS uses hex color codes (#FF5733) but Canvas API, WebGL, and image processing libraries require decimal RGB (255, 87, 51). Manual conversion wastes 5-10 minutes per color palette and introduces typos that break rendering. Worse: alpha channels add complexity. #FF573380 means 50% opacity but you need rgba(255,87,51,0.5) for CSS or [255,87,51,128] for Canvas. Wrong conversion creates invisible elements or incorrect blending—debugging color issues wastes hours.
8-character hex like #FF573380 has 4 components: FF (red), 57 (green), 33 (blue), 80 (alpha). Convert first 6 characters to RGB (255,87,51) normally. For alpha, convert 80 hex to 128 decimal, then divide by 255 = 0.5 opacity for CSS rgba(255,87,51,0.5).
Yes, use decimal→hex conversion for each component. 255 → FF, 87 → 57, 51 → 33. Combine into #FF5733. Pad single-digit results with leading zero: 15 → 0F not F. Most color pickers show both formats—verify hex matches original.
Historical reasons. CSS inherited hex from print design (CMYK workflows). Canvas API mirrors OpenGL conventions using 0-255 integer RGB. WebGL uses 0.0-1.0 floats. Same color, three formats. Convert based on API requirements—hex stays in CSS stylesheets, decimal goes in JavaScript.
#F00 expands to #FF0000 (red). Each digit doubles: F→FF, 0→00. Converts to RGB as 255,0,0. Shorthand saves bytes in CSS but less precise—only 4096 colors vs 16.7 million in full hex. Avoid shorthand in brand colors requiring exact specification.
Type to search tools, use cases, and more...