|
|
@ -932,12 +932,18 @@ channel_set_alpha(unsigned* channel, int alpha){
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Is this channel using the "default color" rather than its RGB?
|
|
|
|
// Is this channel using the "default color" rather than RGB/palette-indexed?
|
|
|
|
static inline bool
|
|
|
|
static inline bool
|
|
|
|
channel_default_p(unsigned channel){
|
|
|
|
channel_default_p(unsigned channel){
|
|
|
|
return !(channel & CELL_BGDEFAULT_MASK);
|
|
|
|
return !(channel & CELL_BGDEFAULT_MASK);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Is this channel using palette-indexed color rather than RGB?
|
|
|
|
|
|
|
|
static inline bool
|
|
|
|
|
|
|
|
channel_palindex_p(unsigned channel){
|
|
|
|
|
|
|
|
return !channel_default_p(channel) && (channel & CELL_BG_PALETTE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Mark the channel as using its default color, which also marks it opaque.
|
|
|
|
// Mark the channel as using its default color, which also marks it opaque.
|
|
|
|
static inline unsigned
|
|
|
|
static inline unsigned
|
|
|
|
channel_set_default(unsigned* channel){
|
|
|
|
channel_set_default(unsigned* channel){
|
|
|
@ -1096,6 +1102,12 @@ channels_fg_default_p(uint64_t channels){
|
|
|
|
return channel_default_p(channels_fchannel(channels));
|
|
|
|
return channel_default_p(channels_fchannel(channels));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Is the foreground using indexed palette color?
|
|
|
|
|
|
|
|
static inline bool
|
|
|
|
|
|
|
|
channels_fg_palindex_p(uint64_t channels){
|
|
|
|
|
|
|
|
return channel_palindex_p(channels_fchannel(channels));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Is the background using the "default background color"? The "default
|
|
|
|
// Is the background using the "default background color"? The "default
|
|
|
|
// background color" must generally be used to take advantage of
|
|
|
|
// background color" must generally be used to take advantage of
|
|
|
|
// terminal-effected transparency.
|
|
|
|
// terminal-effected transparency.
|
|
|
@ -1104,6 +1116,12 @@ channels_bg_default_p(uint64_t channels){
|
|
|
|
return channel_default_p(channels_bchannel(channels));
|
|
|
|
return channel_default_p(channels_bchannel(channels));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Is the background using indexed palette color?
|
|
|
|
|
|
|
|
static inline bool
|
|
|
|
|
|
|
|
channels_bg_palindex_p(uint64_t channels){
|
|
|
|
|
|
|
|
return channel_palindex_p(channels_bchannel(channels));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Mark the foreground channel as using its default color.
|
|
|
|
// Mark the foreground channel as using its default color.
|
|
|
|
static inline uint64_t
|
|
|
|
static inline uint64_t
|
|
|
|
channels_set_fg_default(uint64_t* channels){
|
|
|
|
channels_set_fg_default(uint64_t* channels){
|
|
|
@ -1301,6 +1319,11 @@ cell_fg_default_p(const cell* cl){
|
|
|
|
return channels_fg_default_p(cl->channels);
|
|
|
|
return channels_fg_default_p(cl->channels);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline bool
|
|
|
|
|
|
|
|
cell_fg_palindex_p(const cell* cl){
|
|
|
|
|
|
|
|
return channels_fg_palindex_p(cl->channels);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Is the background using the "default background color"? The "default
|
|
|
|
// Is the background using the "default background color"? The "default
|
|
|
|
// background color" must generally be used to take advantage of
|
|
|
|
// background color" must generally be used to take advantage of
|
|
|
|
// terminal-effected transparency.
|
|
|
|
// terminal-effected transparency.
|
|
|
@ -1309,6 +1332,11 @@ cell_bg_default_p(const cell* cl){
|
|
|
|
return channels_bg_default_p(cl->channels);
|
|
|
|
return channels_bg_default_p(cl->channels);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline bool
|
|
|
|
|
|
|
|
cell_bg_palindex_p(const cell* cl){
|
|
|
|
|
|
|
|
return channels_bg_palindex_p(cl->channels);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Get the current channels or attribute word for ncplane 'n'.
|
|
|
|
// Get the current channels or attribute word for ncplane 'n'.
|
|
|
|
API uint64_t ncplane_channels(const struct ncplane* n);
|
|
|
|
API uint64_t ncplane_channels(const struct ncplane* n);
|
|
|
|
API uint32_t ncplane_attr(const struct ncplane* n);
|
|
|
|
API uint32_t ncplane_attr(const struct ncplane* n);
|
|
|
|