#842 - cont'd: fix typos in documentation.

This commit is contained in:
ManoloFLTK 2024-01-14 14:32:46 +01:00
parent 5c90938aa3
commit c44bea787f
2 changed files with 25 additions and 22 deletions

View File

@ -1,7 +1,7 @@
//
// Optional argument initialization code for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2022 by Bill Spitzak and others.
// Copyright 1998-2024 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@ -107,25 +107,24 @@ extern const char *fl_bg2;
Enables or disables tooltips using Fl_Tooltip::enable().
Color values are commonly given as three digit or six digit hex numbers.
* the order of fg, bg, and bg2 in the command line does not matter
* there is no way at the moment to set the selection color
* setting the bg2 color also changes the fg color to have sufficient contrast
* explicitly setting fg color overrides the bg2/contrast constraint
* setting the bg color will update the color lookup table for the gray ramp,
- The order of fg, bg, and bg2 in the command line does not matter
- There is no way at the moment to set the selection color.
- Setting the bg2 color also changes the fg color to have sufficient contrast
- Explicitly setting fg color overrides the bg2/contrast constraint.
- Setting the bg color will update the color lookup table for the gray ramp,
so color index values can stay the same for all apps, it's just mapped to
different RGB values
* the calculation of the gray ramp is only based on the bg color, so there is
no way at the moment to create an inverted (dark mode) ramp
* consequently, setting bg to black creates a an all-black ramp, setting a
somewhat dark bg color creates a extremely dark ramp
* setting the bg has no influence on bg2 or fg
different RGB values.
- The calculation of the gray ramp is only based on the bg color, so there is
no way at the moment to create an inverted (dark mode) ramp.
- Consequently, setting bg to black creates a an all-black ramp, setting a
somewhat dark bg color creates a extremely dark ramp.
- Setting the bg has no influence on bg2 or fg.
If your program requires other switches in addition to the standard
FLTK options, you will need to pass your own argument handler to
Fl::args(int,char**,int&,Fl_Args_Handler) explicitly.
\see fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b) to see how
\see \ref fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b) to see how
color values can be defined
*/
int Fl::arg(int argc, char **argv, int &i) {

View File

@ -1,7 +1,7 @@
//
// System color support for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2022 by Bill Spitzak and others.
// Copyright 1998-2024 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@ -14,6 +14,10 @@
// https://www.fltk.org/bugs.php
//
/** \file Fl_get_system_colors.cxx
\brief System color support
*/
#include <FL/Fl.H>
#include "Fl_Screen_Driver.H"
#include "Fl_System_Driver.H"
@ -93,19 +97,19 @@ const char *fl_bg2 = NULL;
if it does not conflict with the later rules. Color components are defined
in hexadecimal notation with 1, 2, 3, or four hex digits per component, making
color triplets 3, 6, 9, or 12 characters long. The interpreter is case
insensitive. Valid codes examples include "FF0000" for red, "#0F0" for green,
insensitive. Valid code examples include "FF0000" for red, "#0F0" for green,
and "000000004444" for a dark blue.
On X11 platforms, color values can also be given a color name like "red".
the list of available colors names is provided of the X11 server.
On the X11 platform, color values can also be given a color name like "red".
The list of accepted color names is provided by the X11 server.
If non of the color interpretations work, `fl_parse_color` color returns 0.
The Pixmap reader interprets those a transparent, and are usually written as
If none of the color interpretations work, \ref fl_parse_color returns 0.
The Pixmap reader interprets those as transparent, and are usually written as
"None", "#transparent", or "bg".
\param[in] p a C-string describing the color
\param[out] r, g, b the color components in a range from 0...255
\return 0 if the color can not be interpreted, 1 otherwise
\param[out] r, g, b the color components in the 0...255 range
\return 0 if the color cannot be interpreted, 1 otherwise
*/
int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b) {
return Fl::screen_driver()->parse_color(p, r, g, b);