diff options
author | Thomas White <taw@bitwiz.me.uk> | 2018-10-27 23:06:05 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2018-10-27 23:06:05 +0200 |
commit | 7d585a94af8d021c6d0df0cfd0fe25b6aab367ae (patch) | |
tree | d0d1b16873918d0509b9aa990314d2dbd3d9ef7e /src/sc_interp.c | |
parent | 662ea0cffbda947f363f9f734309066cd93e917f (diff) |
Update values from stylesheet editor
Diffstat (limited to 'src/sc_interp.c')
-rw-r--r-- | src/sc_interp.c | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/src/sc_interp.c b/src/sc_interp.c index 73fc263..91775f5 100644 --- a/src/sc_interp.c +++ b/src/sc_interp.c @@ -464,38 +464,22 @@ static void set_bggrad(SCInterpreter *scin, const char *options, { struct sc_state *st = &scin->state[scin->j]; GdkRGBA col1, col2; - char *n2; - char *optcopy = strdup(options); - if ( options == NULL ) { - fprintf(stderr, _("Invalid bg gradient spec '%s'\n"), options); - return; - } - - n2 = strchr(optcopy, ','); - if ( n2 == NULL ) { - fprintf(stderr, _("Invalid bg gradient spec '%s'\n"), options); - return; - } - - n2[0] = '\0'; + if ( parse_colour_duo(options, &col1, &col2) == 0 ) { - gdk_rgba_parse(&col1, optcopy); - gdk_rgba_parse(&col2, &n2[1]); + st->bgcol[0] = col1.red; + st->bgcol[1] = col1.green; + st->bgcol[2] = col1.blue; + st->bgcol[3] = col1.alpha; - st->bgcol[0] = col1.red; - st->bgcol[1] = col1.green; - st->bgcol[2] = col1.blue; - st->bgcol[3] = col1.alpha; + st->bgcol2[0] = col2.red; + st->bgcol2[1] = col2.green; + st->bgcol2[2] = col2.blue; + st->bgcol2[3] = col2.alpha; - st->bgcol2[0] = col2.red; - st->bgcol2[1] = col2.green; - st->bgcol2[2] = col2.blue; - st->bgcol2[3] = col2.alpha; + st->bggrad = grad; - st->bggrad = grad; - - free(optcopy); + } } |