-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FARCOLORFLAGS docs are outdated #906
Comments
Also from color picker we can know possible underline types:
So currently 5 types are mapped to 4 flags in some (unobvious) way. As for me, it would be more convenient to have 5 separate flags, and just document that they are mutually exclusive. Otherwise, we could introduce five more constants for the allowed combinations of the four existing flags. |
FarColorСтруктура struct rgba
{
unsigned char
r,
g,
b,
a;
};
struct color_index
{
unsigned char
i,
reserved0,
reserved1,
a;
};
struct FarColor
{
FARCOLORFLAGS Flags;
union
{
COLORREF ForegroundColor;
struct color_index ForegroundIndex;
struct rgba ForegroundRGBA;
};
union
{
COLORREF BackgroundColor;
struct color_index BackgroundIndex;
struct rgba BackgroundRGBA;
};
union
{
COLORREF UnderlineColor;
struct color_index UnderlineIndex;
struct rgba UnderlineRGBA;
};
DWORD Reserved;
// ...
UNDERLINE_STYLE GetUnderline() const {/* ... */}
FarColor& SetUnderline(UNDERLINE_STYLE UnderlineStyle) {/* ... */}
// ... кроме того определён ряд других хелперов, полное определение см. в plugin.hpp
}; ЭлементыFlags Может быть комбинацией следующих значений (тип FARCOLORFLAGS):
Расширенные атрибуты, задающие стиль (см. также Замечания):
* Для работы со стилями подчёркивания предусмотрены хелперы GetUnderline() и SetUnderline(). Маски
ForegroundIndex | ForegroundRGBA | ForegroundColor Цвет символа может быть представлен в виде
Warning В данный момент прозрачность поддерживается не везде. Чтобы в будущем избежать неприятных сюрпризов, всегда устанавливайте Alpha-канал (старший байт значения Note Для комфортной работы со структурами также предусмотрен ряд хелперов, см. BackgroundIndex | BackgroundRGBA | BackgroundColor Цвет фона символа, в зависимости от флага FCF_BG_INDEX, формат тот же что у Foreground* UnderlineIndex | UnderlineRGBA | UnderlineColor Цвет подчёркивания, в зависимости от флага FCF_FG_UNDERLINE_INDEX, формат тот же что у Foreground*. Reserved Не используется и должен быть установлен в 0. ЗамечанияПри использовании цветов из палитры обязательно указывайте флаги Стандартные цвета консоли Windows представляют собой палитру из 16 цветов, с индексами 0 - 15. Также можно использовать цвета из палитры VT100 (16 - 255). В этом случае значения (16 - 231) кодируются как 36R+6G+B, где уровень каждого из основных цветов 0-5, а последние 24 значения (232 - 255) используются для оттенков серого [желательна ссылка на определение VT color cube]. Warning
Смотрите также: [вероятно стоит приложить и cheat sheet?] |
|
Outdated.
https://forum.farmanager.com/viewtopic.php?p=168086
It is FCF_INVERSE now.
This is not a style flag, but a switch between index and RGB.
Users are not supposed to do that manually, so no need to document.
It's UnderlineColor now.
Yep.
Files highlighting.
Faint is "reduce text intenseness". We do not do anything funny with these flags, just pass them to the terminal.
Yes, to pre-Windows 10 values. Same as "Vintage" in WT. |
Исправил.
Из того, что это чекбокс, а не просто кнопка, предполагается что фар активно препятствует изменению палитры? |
Up to you. If checked, we set the palette at startup and then every time something is executed from the command line. |
FCF_INHERIT_STYLE действует также и для Editor -> Selected text, и ECTL_ADDCOLOR? Про LVB console attributes ничего конкретного больше не надо сказать? |
I propose my help in Russian proofreading (spelling, punctuation, grammar, style, etc). If nobody minds, please let me know when the text is ready for a clean-up. |
Probably. LVB should be treated as opaque. |
It is ready, more or less. Probably there can be some changes later, when it will be converted to html. |
E.g.
FCF_FG_UNDERLINE
does not exist anymore, but there areFCF_FG_UNDERLINE_INDEX
,FCF_FG_U_DATA0
,FCF_FG_U_DATA1
,FCF_FG_U_DATA2
andFCF_FG_UNDERLINE_MASK
instead.Other not yet documented flags include
FCF_FG_OVERLINE
,FCF_FG_STRIKEOUT
,FCF_FG_FAINT
,FCF_FG_BLINK
,FCF_FG_INVERSE
,FCF_FG_INVISIBLE
,FCF_STYLEMASK
,FCF_RAWATTR_MASK
.Compare https://api.farmanager.com/ru/structures/farcolor.html with the sources:
Details
FarManager/far/plugin.hpp
Lines 104 to 142 in 283c2a1
The text was updated successfully, but these errors were encountered: