Skip to content

Getting a Color from HSL #2044

Answered by Atulin
Atulin asked this question in Ideas
Mar 7, 2022 · 1 comments · 9 replies
Discussion options

You must be logged in to vote

And immediately as I wrote it, the issue is solved...

var color = new Hsl(hue, saturation, lightness);
var converter = new ColorSpaceConverter();
var c = converter.ToRgb(color);
var stop = new ColorStop(0f, new Color((Rgba32)c));

never thought I'd need so much code to do it, but at least it works.

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@JimBobSquarePants
Comment options

@LucasVos
Comment options

@br3aker
Comment options

@LucasVos
Comment options

@JimBobSquarePants
Comment options

Answer selected by Atulin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
4 participants