Class: HSV
Defined in: src/utils/ManimColor.ts:322
HSV color space, a ManimColor subclass.
It is constructed from [h,s,v] (or [h,s,v,a]) floats in 0.0..1.0 and keeps
that representation internally, so operators and ManimColor.interpolate
act in HSV space.
Extends
Constructors
Constructor
new HSV(
hsv,alpha):HSV
Defined in: src/utils/ManimColor.ts:325
Parameters
hsv
[number, number, number, number] | Hsv
alpha
number = 1.0
Returns
HSV
Overrides
Properties
value
protectedreadonlyvalue:Rgba
Defined in: src/utils/ManimColor.ts:104
Inherited from
Accessors
h
Get Signature
get h():
number
Defined in: src/utils/ManimColor.ts:354
Returns
number
s
Get Signature
get s():
number
Defined in: src/utils/ManimColor.ts:358
Returns
number
v
Get Signature
get v():
number
Defined in: src/utils/ManimColor.ts:362
Returns
number
Methods
constructFromSpace()
protectedconstructFromSpace(space):ManimColor
Defined in: src/utils/ManimColor.ts:345
Build a color of this class from a space array. Overridden by subclasses.
Parameters
space
number[]
Returns
Overrides
darker()
darker(
blend):ManimColor
Defined in: src/utils/ManimColor.ts:237
Return a darker color: interpolated toward black. The opacity is unchanged.
Parameters
blend
number = 0.2
0.0 (unchanged) to 1.0 (pure black). Default 0.2.
Returns
Inherited from
equals()
equals(
other):boolean
Defined in: src/utils/ManimColor.ts:257
Compare two colors with a numpy-style allclose tolerance.
Parameters
other
Returns
boolean
Inherited from
fromInternal()
protectedfromInternal(rgba):ManimColor
Defined in: src/utils/ManimColor.ts:349
Build a color of this class from an [r,g,b,a] value (ManimCE _from_internal).
Parameters
rgba
Rgba
Returns
Overrides
getSpace()
protectedgetSpace():number[]
Defined in: src/utils/ManimColor.ts:341
The space used for operators and interpolation ([r,g,b,a] for the base).
Returns
number[]
Overrides
internalRgba()
protectedinternalRgba():Rgba
Defined in: src/utils/ManimColor.ts:336
The [r,g,b,a] internal value. Overridden by subclasses.
Returns
Rgba
Overrides
interpolate()
interpolate(
other,alpha):ManimColor
Defined in: src/utils/ManimColor.ts:200
Interpolate toward other in this color's space.
alpha 0.0 returns a copy of this color, 1.0 returns other.
Parameters
other
alpha
number
Returns
Inherited from
invert()
invert(
withAlpha):ManimColor
Defined in: src/utils/ManimColor.ts:211
Return a linearly inverted color (1 - channel).
Parameters
withAlpha
boolean = false
If true, the alpha is inverted too. Default false.
Returns
Inherited from
lighter()
lighter(
blend):ManimColor
Defined in: src/utils/ManimColor.ts:248
Return a lighter color: interpolated toward white. The opacity is unchanged.
Parameters
blend
number = 0.2
0.0 (unchanged) to 1.0 (pure white). Default 0.2.
Returns
Inherited from
opacity()
opacity(
opacity):ManimColor
Defined in: src/utils/ManimColor.ts:221
Return a new color with the given opacity and the same color values.
Parameters
opacity
number
Returns
Inherited from
toHex()
toHex(
withAlpha):string
Defined in: src/utils/ManimColor.ts:182
Convert to a #RRGGBB hex string, or #RRGGBBAA when withAlpha is true.
Parameters
withAlpha
boolean = false
Returns
string
Inherited from
toHsv()
toHsv():
Hsv
Defined in: src/utils/ManimColor.ts:189
Convert to an [h,s,v] float array (0.0..1.0).
Returns
Hsv
Inherited from
toIntRgb()
toIntRgb():
Rgb
Defined in: src/utils/ManimColor.ts:168
Convert to an [r,g,b] integer array (0..255, truncated).
Returns
Rgb
Inherited from
toIntRgba()
toIntRgba():
Rgba
Defined in: src/utils/ManimColor.ts:174
Convert to an [r,g,b,a] integer array (0..255, truncated).
Returns
Rgba
Inherited from
toRgb()
toRgb():
Rgb
Defined in: src/utils/ManimColor.ts:156
Convert to an [r,g,b] float array (0.0..1.0).
Returns
Rgb
Inherited from
toRgba()
toRgba():
Rgba
Defined in: src/utils/ManimColor.ts:162
Convert to an [r,g,b,a] float array (0.0..1.0).
Returns
Rgba
Inherited from
toString()
toString():
string
Defined in: src/utils/ManimColor.ts:264
Return the #RRGGBB hex string, so a color interpolates into templates.
Returns
string
Inherited from
withAlpha()
withAlpha(
alpha):ManimColor
Defined in: src/utils/ManimColor.ts:228
Alias of opacity.
Parameters
alpha
number
Returns
Inherited from
fromHex()
staticfromHex(hex,alpha):ManimColor
Defined in: src/utils/ManimColor.ts:281
Create a color from a hex string. Ports ManimColor.from_hex.
Parameters
hex
string
alpha
number = 1.0
Returns
Inherited from
fromHsv()
staticfromHsv(hsv,alpha):ManimColor
Defined in: src/utils/ManimColor.ts:286
Create a color from an [h,s,v] float array. Ports ManimColor.from_hsv.
Parameters
hsv
Hsv
alpha
number = 1.0
Returns
Inherited from
fromRgb()
staticfromRgb(rgb,alpha):ManimColor
Defined in: src/utils/ManimColor.ts:271
Create a color from an RGB(A) float array. Ports ManimColor.from_rgb.
Parameters
rgb
Rgb | Rgba
alpha
number = 1.0
Returns
Inherited from
fromRgba()
staticfromRgba(rgba):ManimColor
Defined in: src/utils/ManimColor.ts:276
Create a color from an RGBA float array. Ports ManimColor.from_rgba.
Parameters
rgba
Rgba
Returns
Inherited from
parse()
staticparse(color,alpha):ManimColor|ManimColor[]
Defined in: src/utils/ManimColor.ts:299
Parse one color, or a list of colors.
A numeric array (length 3 or 4) is read as a single RGB(A) color. An array
whose elements are themselves colors (strings, numbers-as-ints via nested
arrays, or ManimColors) is read as a list. This resolves ManimCE's
documented "array of numbers becomes a list of colors" footgun in favor of
the single-color reading.
Parameters
color
ParsableManimColor | ParsableManimColor[]
alpha
number = 1.0
Returns
ManimColor | ManimColor[]