vue-color-wheel icon indicating copy to clipboard operation
vue-color-wheel copied to clipboard

Mitigate muddy/gray colors in the middle of the background gradient animation

Open argyleink opened this issue 11 months ago • 1 comments

Current

#app-wrapper {
  background: 
    linear-gradient(47.625deg, rgb(84, 235, 235), rgba(255, 0, 0, 0) 79.475%), 
    linear-gradient(95.25deg, rgb(235, 84, 84), rgba(0, 255, 0, 0) 79.475%)
  ;
}

Proposed (progressive enhancement)

:root {
  --space:;
  @supports (background: linear-gradient(in oklab, #000, #fff)) {
    --space: in oklab;
  }  
}

#app-wrapper {
  background: 
    linear-gradient(47.625deg var(--space), rgb(84, 235, 235), rgba(255, 0, 0, 0) 79.475%), 
    linear-gradient(95.25deg var(--space), rgb(235, 84, 84), rgba(0, 255, 0, 0) 79.475%)
  ;
}

As shown here https://developer.chrome.com/docs/css-ui/high-definition-css-color-guide#color_interpolation, this will interpolate the gradients in a colorspace that's less likely to go through the middle of the space which is desaturated. it should make the bg effect more vibrant!

argyleink avatar Mar 05 '24 17:03 argyleink

@argyleink Thanks for sharing, I will improve it.

xiaoluoboding avatar Mar 06 '24 01:03 xiaoluoboding