mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Add Color classes for use with AddressableLED (#2127)
Both floating point and 8-bit integer classes are included, as well as a wide selection of color constants. Co-authored-by: Austin Shalit <austinshalit@gmail.com>
This commit is contained in:
committed by
Peter Johnson
parent
96348e835a
commit
e874ba9313
@@ -12,6 +12,17 @@ public final class MathUtil {
|
||||
throw new AssertionError("utility class");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns value clamped between low and high boundaries.
|
||||
*
|
||||
* @param value Value to clamp.
|
||||
* @param low The lower boundary to which to clamp value.
|
||||
* @param high The higher boundary to which to clamp value.
|
||||
*/
|
||||
public static int clamp(int value, int low, int high) {
|
||||
return Math.max(low, Math.min(value, high));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns value clamped between low and high boundaries.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user