Review Request 123809: Use list of hard coded colors instead of generating it

Milian Wolff mail at milianw.de
Mon May 18 15:49:38 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/123809/#review80580
-----------------------------------------------------------

Ship it!


I like it - thanks!

one small nitpicks then this could be merged in and we can try it out.

also, please document in the source code where you got the colors from


language/highlighting/colorcache.cpp (line 108)
<https://git.reviewboard.kde.org/r/123809/#comment55243>

    here and below: use initializer_list, that should work if you include the header and then simply do
    
    const auto colors = {...};
    const auto supplementaryColors = {...};
    
    or a plain array would also be OK:
    
    const QColor colors[] = {...};
    const QColor supplementaryColors[] = {...};
    
    the range-for-loop will still work either way, afaik.


- Milian Wolff


On May 17, 2015, 6:48 p.m., Sergey Kalinichev wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/123809/
> -----------------------------------------------------------
> 
> (Updated May 17, 2015, 6:48 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdevplatform
> 
> 
> Description
> -------
> 
> This fixes 2 issues:
> 
> *Currently rainbow highlighting only works for the first 10 declarations in Function and Other contexts. All other declarations get highlighted with the default color.
> *The current interpolation algorithm is very poor, it can generate only about 10 different colors, all other look alike.
>     
> So this patch adds ~35 distinguishable colors, which should be more than enough for most cases.
> 
> 
> Diffs
> -----
> 
>   language/highlighting/codehighlighting.cpp 59a7ffc 
>   language/highlighting/colorcache.h d04dfc5 
>   language/highlighting/colorcache.cpp e2729f2 
> 
> Diff: https://git.reviewboard.kde.org/r/123809/diff/
> 
> 
> Testing
> -------
> 
> 
> File Attachments
> ----------------
> 
> primary_colors.png
>   https://git.reviewboard.kde.org/media/uploaded/files/2015/05/17/4b5c74df-4f42-4a0d-8384-e82bd2b1214f__primary_colors.png
> all_colors.png
>   https://git.reviewboard.kde.org/media/uploaded/files/2015/05/17/6f700794-b2d1-4a48-97d4-3e354f3e7701__all_colors.png
> 
> 
> Thanks,
> 
> Sergey Kalinichev
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20150518/ee8dee5a/attachment.html>


More information about the KDevelop-devel mailing list