Namespace-style class for color math, randomization, and note helpers.
More...
#include <Utility.h>
Namespace-style class for color math, randomization, and note helpers.
Concrete implementations of Utility helpers.
Definition at line 15 of file Utility.h.
◆ alphaComponentOf:
| + (float) alphaComponentOf: |
|
(NSColor *) | color |
|
Extracts the respective component in calibrated RGB space.
Returns the component value in calibrated RGB space or 0 on failure.
Definition at line 115 of file Utility.m.
◆ blueComponentOf:
| + (float) blueComponentOf: |
|
(NSColor *) | color |
|
Extracts the respective component in calibrated RGB space.
Returns the component value in calibrated RGB space or 0 on failure.
Definition at line 105 of file Utility.m.
◆ brighterColor:
| + (NSColor *) brighterColor: |
|
(NSColor *) | inColor |
|
Returns a darker/brighter color variant.
Increases RGB toward 1.0 to produce a brighter color.
Definition at line 143 of file Utility.m.
◆ colorForNote:
| + (NSColor *) colorForNote: |
|
(int) | note |
|
Deterministic color mapping for a given MIDI note.
Maps a MIDI note to a hue/brightness for consistent pad coloring.
Definition at line 38 of file Utility.m.
◆ darkerColor:
| + (NSColor *) darkerColor: |
|
(NSColor *) | inColor |
|
Returns a darker/brighter color variant.
Scales RGB by a constant factor to produce a darker color.
Definition at line 128 of file Utility.m.
◆ getIndentForLevel:
| + (NSString *) getIndentForLevel: |
|
(int) | level |
|
Returns a string of spaces for the given indent level.
Builds a space string for indentation (level * 2), clamped to 8 spaces.
Definition at line 166 of file Utility.m.
◆ greenComponentOf:
| + (float) greenComponentOf: |
|
(NSColor *) | color |
|
Extracts the respective component in calibrated RGB space.
Returns the component value in calibrated RGB space or 0 on failure.
Definition at line 95 of file Utility.m.
◆ makeRgbColor:green:blue:alpha:
| + (NSColor *) makeRgbColor: |
|
(CGFloat) | red |
| green: |
|
(CGFloat) | green |
| blue: |
|
(CGFloat) | blue |
| alpha: |
|
(CGFloat) | alpha |
Convenience to create a calibrated RGB color.
Convenience to create a calibrated RGB color with components.
Definition at line 77 of file Utility.m.
◆ randomColor:
| + (NSColor *) randomColor: |
|
(CGFloat) | saturation |
|
Generates a random color with the given saturation.
Creates a random calibrated RGB color with the given saturation.
Definition at line 64 of file Utility.m.
◆ randomPointInBounds:
| + (NSPoint) randomPointInBounds: |
|
(NSRect) | bounds |
|
Returns a random point within the given bounds.
Returns a random point uniformly distributed within bounds.
Definition at line 181 of file Utility.m.
◆ redComponentOf:
| + (float) redComponentOf: |
|
(NSColor *) | color |
|
Extracts the respective component in calibrated RGB space.
Returns the component value in calibrated RGB space or 0 on failure.
Definition at line 85 of file Utility.m.
◆ stringFromNote:
| + (NSString *) stringFromNote: |
|
(int) | note |
|
Formats a MIDI note number as a string like [C3].
Converts a MIDI note number to a label like [C3].
Definition at line 30 of file Utility.m.
The documentation for this class was generated from the following files: