Implement SGR dim

kitty now supports the SGR DIM escape code, which makes text fade into
the background. It works by alpha blending the text color into the
background color. Fixes #446
This commit is contained in:
Kovid Goyal
2018-05-20 10:43:26 +05:30
parent 9cab8a2de5
commit 6f2d63eb87
11 changed files with 54 additions and 32 deletions

View File

@@ -149,7 +149,7 @@ set_attribute(LineBuf *self, PyObject *args) {
#define set_attribute_doc "set_attribute(which, val) -> Set the attribute on all cells in the line."
unsigned int shift, val;
if (!PyArg_ParseTuple(args, "II", &shift, &val)) return NULL;
if (shift < DECORATION_SHIFT || shift > STRIKE_SHIFT) { PyErr_SetString(PyExc_ValueError, "Unknown attribute"); return NULL; }
if (shift < DECORATION_SHIFT || shift > DIM_SHIFT) { PyErr_SetString(PyExc_ValueError, "Unknown attribute"); return NULL; }
linebuf_set_attribute(self, shift, val);
Py_RETURN_NONE;
}