[kdialog] indirectly implement output color format swizzle
Needs ReviewPublic

Authored by yuehangwu on Mar 16 2017, 1:53 PM.

Details

Reviewers
cfeck
Summary

Since ISO C++11 does not support %n$ operand number formats [-Wformat=], this patch indirectly implement it by regex and reorder the RGB channel before sending
to asprintf

Test Plan

RGB or v.rgb
kdialog --getcolor --format "%#3f, %#+f, %+4f);"

BGR or v.bgr
kdialog --getcolor --format "%3\$#3f, %2\$#+f, %1\$+4f);"

RRR or v.rrr
kdialog --getcolor --format "%1\$#3f, %1\$#+f, %1\$+4f);"

Diff Detail

Repository
R229 KDialog
Lint
Lint Skipped
Unit
Unit Tests Skipped
yuehangwu created this revision.Mar 16 2017, 1:53 PM

hi @cfeck in the last patch about allowing output color format, I left two unsolved. One of them is color reorder or swizzle which seems convenient to uses for arbitrarily handle color channels. Please take a look thanks.