Color is a what you think, almost. However, the upper bits of the color are used to indicate special behaviors. If the value upper 24-bits are clear, then the value is an index into a palette (typically it should be less than 256). If the isRGB bit is set, then the lower 24 bits are a 24-bit direct color (RGB).
Return true if c1 is darker than c2.
decompose a color into red, green, and blue values.
decompose a color into red, green, and blue values.
Create a color from RGB values.
Is the color in RGB format? RGB format colors will try to be accurate on the terminal, and will not honor user preferences.
Obtain the numeric value of the RGB for the color.
Given a color, try to find an associated palette entry for it. This will try to find the lowest numbered palette entry. The palette entry might be a higher numbered color than the terminal can support, if it does not support a 256 color palette.
Convert a color to RGB form. This is useful to convert palette based colors to their full RGB values, which will provide fidelity when the terminal supports it, but consequently does not honor terminal preferences for color palettes.
Copyright 2022 Garrett D'Amore
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE or https://www.boost.org/LICENSE_1_0.txt) SPDX-License-Identifier: BSL-1.0
Color module for dcell.