question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Easy way to add colour fill with gradient?

See original GitHub issue

We can set the fill colour using the fillcolor parameter which accepts colour names and rgb values. This, however, only allows single colours. Is there an easy way to make gradient colours? Below is what I’m actually trying to achieve:

Screenshot_2021-01-14 About Gold HelloGold

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:9
  • Comments:5

github_iconTop GitHub Comments

2reactions
lukeiccommented, Nov 1, 2021
Screen Shot 2021-11-01 at 6 00 45 pm Screen Shot 2021-11-01 at 6 01 18 pm

I’ve successfully emulated this effect by using a pseudo-element and a linear-gradient:

.scorecard__graph {
    position: relative;
}

.scorecard__graph::before {
    content: '';
    display: block;
    background: linear-gradient(#fff0, white);
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 75%;
    z-index: 10;
}

Simply change height, or the colours’ start/end position in the linear-gradient, to increase or decrease the size of the gradient (i.e. the faded-out bit).

NOTES:

  1. I’ve disabled the x and y axis titles.
  2. .scorecard__graph is the class given to the dcc.Graph() element (I’m using Python).
0reactions
etiennecelerycommented, Sep 6, 2022

Hi, any updates with the implementation of the background fill?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Add Gradient Fill Color in Microsoft Word Background ...
In this video, MS Office Tutorial- How to Add Gradient Fill Color in Microsoft Word Background 2017. Create Textbox and Go to the...
Read more >
Use gradients in Photoshop
Apply a gradient fill · Specify a blending mode and opacity for the paint. · To reverse the order of colors in the...
Read more >
(Legacy) Adobe Photoshop CS3: Applying a Gradient
Select your Foreground and Background colors. · Select the area you wish to apply the gradient to. · From the Toolbox, select the...
Read more >
How to Apply Fill Colors, Patterns, and Gradients to Cells in ...
Use the Fill Effects dialog box to apply a gradient effect to selected cells. Select the two colors you want to use in...
Read more >
Fill with the Gradient Fill tool - Pixelmator Pro User Guide
A gradient will always have at least two colors. Each color is represented by color stops on a fill bar. You can change...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found