chore: update color setter methods to be more explicit

This commit is contained in:
Adam
2025-04-15 12:07:27 -07:00
parent 01ab78db97
commit 56bc96fa76
2 changed files with 12 additions and 12 deletions

View File

@@ -20,10 +20,10 @@ export default function useViewModelInstanceColor(
{
value: number;
setValue: (value: number) => void;
rgb: (r: number, g: number, b: number) => void;
rgba: (r: number, g: number, b: number, a: number) => void;
alpha: (a: number) => void;
opacity: (o: number) => void;
setRgb: (r: number, g: number, b: number) => void;
setRgba: (r: number, g: number, b: number, a: number) => void;
setAlpha: (a: number) => void;
setOpacity: (o: number) => void;
}
>(
path,
@@ -34,10 +34,10 @@ export default function useViewModelInstanceColor(
(instance, value, setValue) => ({
value,
setValue,
rgb: (r, g, b) => instance?.rgb(r, g, b),
rgba: (r, g, b, a) => instance?.rgba(r, g, b, a),
alpha: (a) => instance?.alpha(a),
opacity: (o) => instance?.opacity(o),
setRgb: (r, g, b) => instance?.rgb(r, g, b),
setRgba: (r, g, b, a) => instance?.rgba(r, g, b, a),
setAlpha: (a) => instance?.alpha(a),
setOpacity: (o) => instance?.opacity(o),
})
);
}

View File

@@ -178,7 +178,7 @@ export type UseViewModelInstanceColorResult = {
* Set the red value of the color.
* @param r - The red value to set the color to.
*/
rgb: (r: number, g: number, b: number) => void;
setRgb: (r: number, g: number, b: number) => void;
/**
* Set the red, green, blue, and alpha values of the color.
* @param r - The red value to set the color to.
@@ -186,17 +186,17 @@ export type UseViewModelInstanceColorResult = {
* @param b - The blue value to set the color to.
* @param a - The alpha value to set the color to.
*/
rgba: (r: number, g: number, b: number, a: number) => void;
setRgba: (r: number, g: number, b: number, a: number) => void;
/**
* Set the alpha value of the color.
* @param a - The alpha value to set the color to.
*/
alpha: (a: number) => void;
setAlpha: (a: number) => void;
/**
* Set the opacity value of the color.
* @param o - The opacity value to set the color to.
*/
opacity: (o: number) => void;
setOpacity: (o: number) => void;
};
export type UseViewModelInstanceEnumResult = {