Discussion "More built-in named colors for FLTK 1.5?" (#1259).
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled

A new file FL/rgb_colors.H is created to define 490 color names.
This file derives from Xorg's rgb.txt list of color names.
The purpose and use of this file is documented.
This commit is contained in:
ManoloFLTK
2026-04-20 16:34:07 +02:00
parent d62138eb41
commit 71c26d47f5
2 changed files with 513 additions and 0 deletions
+508
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -264,6 +264,11 @@ Color values greater than 255 are treated as 24-bit RGB values. These are mapped
to the closest color supported by the screen, either from one of the 256 colors
in the FLTK colormap or a direct RGB value on TrueColor screens.
File FL/rgb_colors.H defines 490 constants of type Fl_Color than can be used to identify
many colors by a name. The names of these constants (example: FL_RGB_ALICE_BLUE) begin
with the "FL_RGB_" prefix and use the English-language color names of Xorg's "share/X11/rgb.txt" file
and their values. Include <FL/rgb_colors.H> in your program to gain access to these color names.
Fl_Color fl_rgb_color(uchar r, uchar g, uchar b) <br>
Fl_Color fl_rgb_color(uchar grayscale)