mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-10-31 15:20:13 +00:00
update new python for CHANNEL_RGB change
This commit is contained in:
parent
3123911637
commit
603fd770fe
@ -11,11 +11,11 @@ notcurses_channels - operations on notcurses channels
|
||||
**#include <notcurses/notcurses.h>**
|
||||
|
||||
```c
|
||||
#define CHANNELS_RGB_INITIALIZER(fr, fg, fb, br, bg, bb) \
|
||||
#define NCCHANNELS_INITIALIZER(fr, fg, fb, br, bg, bb) \
|
||||
(((((uint64_t)(fr) << 16u) + ((uint64_t)(fg) << 8u) + (uint64_t)(fb)) << 32ull) + \
|
||||
(((br) << 16u) + ((bg) << 8u) + (bb)) + CELL_BGDEFAULT_MASK + CELL_FGDEFAULT_MASK)
|
||||
|
||||
#define CHANNEL_RGB_INITIALIZER(r, g, b) \
|
||||
#define CHANNEL_INITIALIZER(r, g, b) \
|
||||
(((uint32_t)r << 16u) + ((uint32_t)g << 8u) + (b) + CELL_BGDEFAULT_MASK)
|
||||
```
|
||||
|
||||
|
@ -24,7 +24,7 @@ python_ncchannels_rgb_initializer(PyObject *Py_UNUSED(self), PyObject *args)
|
||||
|
||||
GNU_PY_CHECK_BOOL(PyArg_ParseTuple(args, "KKKKKK", &fr, &fg, &fb, &br, &bg, &bb));
|
||||
|
||||
unsigned long long ncchannels = CHANNELS_RGB_INITIALIZER(fr, fg, fb, br, bg, bb);
|
||||
unsigned long long ncchannels = NCCHANNELS_INITIALIZER(fr, fg, fb, br, bg, bb);
|
||||
|
||||
return Py_BuildValue("K", ncchannels);
|
||||
}
|
||||
@ -36,7 +36,7 @@ python_ncchannel_rgb_initializer(PyObject *Py_UNUSED(self), PyObject *args)
|
||||
|
||||
GNU_PY_CHECK_BOOL(PyArg_ParseTuple(args, "kkk", &r, &g, &b));
|
||||
|
||||
unsigned long ncchannel = CHANNEL_RGB_INITIALIZER(r, g, b);
|
||||
unsigned long ncchannel = CHANNEL_INITIALIZER(r, g, b);
|
||||
|
||||
return Py_BuildValue("k", ncchannel);
|
||||
}
|
||||
@ -611,4 +611,4 @@ PyMethodDef ChannelsFunctions[] = {
|
||||
{"ncchannels_set_fg_default", (PyCFunction)python_ncchannels_set_fg_default, METH_VARARGS, "Mark the foreground ncchannel as using its default color."},
|
||||
{"ncchannels_set_bg_default", (PyCFunction)python_ncchannels_set_bg_default, METH_VARARGS, "Mark the background ncchannel as using its default color."},
|
||||
{NULL, NULL, 0, NULL},
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user