Vixen
02b45cc4
csharp
public readonly record struct Hsv

A colour as hue, saturation and value.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ Kept alongside the RGB rather than derived from it on demand. Grey has no hue, so a picker that recomputed HSV from the colour would lose which hue the user was on the moment they dragged the saturation to zero — and the field would jump back to red when they dragged it out again. Every picker that has this bug has it for that reason.

Fields and properties (3)

  • public float H

    Hue in degrees, 0 to 360.

  • public float S

    Saturation, 0 to 1.

  • public float V

    Value, 0 to 1.

Methods (3)

  • public Hsv(float H, float S, float V)

    A colour as hue, saturation and value.

  • public static Hsv FromRgb(Color4 color)

    Converts an sRGB colour.

  • public Color4 ToRgb(float alpha = 1)

    Converts back.

Used by (5)

  • ColorFieldVixen.Ui.Controls.Advanced
  • ColorModelTestsVixen.Ui.Controls.Advanced.Tests
  • ColorPickerVixen.Ui.Controls.Advanced
  • ColorPickerTestsVixen.Ui.Controls.Advanced.Tests
  • ColorStripVixen.Ui.Controls.Advanced