Skip to content

color of block appears transparent instead of light gray when it is equal to zero #12

Description

@coofzilla

I'm following the demo code and the blocks are transparent when the value is equal to 0.

I changed the following to make it appear gray:

// Original Implementation:
//                    RoundedRectangle(cornerRadius: heatMapRectangleRadius)
//                        .frame(width: heatMapRectangleWidth, height: heatMapRectangleWidth, alignment: .center)
//                        .foregroundColor(blockColor
//                            .opacity(opacityRatio(index: index)))


                    RoundedRectangle(cornerRadius: heatMapRectangleRadius)
                        .frame(width: heatMapRectangleWidth, height: heatMapRectangleWidth, alignment: .center)
                        .foregroundColor(rowData[index] == 0 ?
                            Color(red: 0.9, green: 0.9, blue: 0.9) :
                            blockColor.opacity(opacityRatio(index: index))
                        )

Before:

image

After:

image

not sure if I'm doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions