Skip to content

How to set BackGround color for even and odd rows #488

Answered by mikekazakov
spn13 asked this question in Q&A
Discussion options

You must be logged in to vote

These colors are calculated as an alpha-based blend between the primary color and the background color (filePanelsListRegularEvenRowBackgroundColor/filePanelsListRegularOddRowBackgroundColor):

static NSColor *Blend(NSColor *_front, NSColor *_back)
{
const auto alpha = _front.alphaComponent;
if( alpha == 1. )
return _front;
if( alpha == 0. )
return _back;
const auto cs = NSColorSpace.genericRGBColorSpace;
_front = [_front colorUsingColorSpace:cs];
_back = [_back colorUsingColorSpace:cs];
const auto

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by spn13
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants