---
name: "al_color_rgb_to_cmyk"
section: "3"
platform: "linux"
package: "allegro"
version: "5.2.11.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/al_color_rgb_to_cmyk"
---

# al\_color\_rgb\_to\_cmyk(3)

Allegro 5 API

## NAME

al\_color\_rgb\_to\_cmyk - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro_color.h>
  void al_color_rgb_to_cmyk(float red, float green, float blue,
     float *cyan, float *magenta, float *yellow, float *key)
  ```

## DESCRIPTION

Each RGB color can be represented in CMYK with a K component of 0 with the following formula:

-

  ```
  C = 1 - R
  M = 1 - G
  Y = 1 - B
  K = 0
  ```

This function will instead find the representation with the maximal value for K and minimal color components.

## SEE ALSO

[al\_color\_cmyk(3)](/al_color_cmyk/3.md), [al\_color\_cmyk\_to\_rgb(3)](/al_color_cmyk_to_rgb/3.md)
