Color Code Converter

Convert colors between Hex, RGB, HSL, HSV, and CMYK formats. Perfect for customizing Pine Script indicators and web design.

Supports: #RGB, #RRGGBB, rgb(r,g,b), rgba(r,g,b,a), hsl(h,s,l), hsv(h,s,v), cmyk(c,m,y,k)

Hex
#3B82F6
RGB
rgb(59, 130, 246)
RGBA
rgba(59, 130, 246, 1.00)
HSL
hsl(217, 91%, 60%)
HSLA
hsla(217, 91%, 60%, 1.00)
HSV/HSB
hsv(217, 76%, 96%)
CMYK
cmyk(76%, 47%, 0%, 4%)

What is a Color Code Converter?

A color code converter is an essential tool for developers, designers, and Pine Script programmers who need to work with colors across different formats. This free online converter allows you to instantly transform colors between Hex, RGB, RGBA, HSL, HSV, and CMYK formats.

Whether you are building web applications, designing trading indicators in Pine Script, or creating visual content, having the ability to quickly convert between color formats is invaluable. Our converter supports all major color formats used in modern development.

Supported Color Formats

This converter understands and converts between the following color formats:

  • Hex (#RRGGBB, #RGB): The most common format for web design and CSS. Hex codes use six or three hexadecimal digits to represent red, green, and blue values.
  • RGB (rgb(r, g, b)): Red, Green, Blue values on a scale of 0-255. The standard format for digital displays and image processing.
  • RGBA (rgba(r, g, b, a)): RGB with an alpha channel for transparency. The 'a' value ranges from 0 to 1, where 0 is fully transparent and 1 is fully opaque.
  • HSL (hsl(h, s%, l%)): Hue, Saturation, Lightness. An intuitive format where Hue is in degrees (0-360), and Saturation/Lightness are percentages.
  • HSV/HSB (hsv(h, s%, v%)): Hue, Saturation, Value/Brightness. Similar to HSL but uses Value instead of Lightness for a different color perception model.
  • CMYK (cmyk(c%, m%, y%, k%)): Cyan, Magenta, Yellow, Key (Black). The standard format for print and color printing.

Color Formats in Pine Script

For TradingView Pine Script developers, color format compatibility is crucial when customizing indicator colors. Pine Script v5 supports various color input methods:

  • Hex colors: Directly supported in Pine Script with the #RRGGBB or #RRGGBBAA format (AA for transparency).
  • RGB colors: Use the color.rgb(r, g, b, a) function to specify colors programmatically.
  • Built-in colors: Pine Script provides named colors like color.blue, color.red, and many others.

Our converter is particularly useful for Pine Script developers who need to match TradingView's color picker output with specific RGB or Hex values for their custom indicators.

How to Use This Color Converter

Using our color code converter is straightforward:

  1. Enter your color: Type or paste a color in any supported format into the input field. You can use Hex, RGB, RGBA, HSL, HSV, or CMYK notation.
  2. Adjust transparency: Use the alpha field to set transparency (1.0 = fully opaque, 0 = fully transparent).
  3. View all conversions: Instantly see your color converted to all other supported formats.
  4. Copy the result: Click the copy button next to any format to copy it to your clipboard.
  5. Use preset colors: Quick-select from common colors for faster conversions.

Common Use Cases

Web Development

Web developers frequently need to convert between color formats for CSS styling, responsive design, and cross-browser compatibility. Hex codes are standard for CSS, while RGBA is essential for implementing transparency and overlays.

Pine Script Development

TradingView Pine Script developers use this tool to match TradingView's color picker outputs with their code. When you pick a color in TradingView, you get a Hex code that you can use directly or convert to RGB for programmatic color manipulation in your scripts.

Design and Branding

Designers often need to convert colors between formats for different output channels. CMYK is essential for print materials, while RGB/Hex is required for digital platforms. Maintaining brand consistency across all channels requires reliable color conversion.

Data Visualization

When creating charts, dashboards, or trading indicators, developers need to programmatically generate color palettes. Converting between HSL and RGB allows for systematic color generation based on hue rotation while maintaining consistent saturation and lightness.

Build Custom Indicators with Perfect Colors

You've converted your colors—now put them to work in custom Pine Script indicators. Pineify's AI-powered generator creates production-ready code with your exact color specifications for TradingView.