(
object: IColorable,
useHSLColorTransition: boolean
)
| 209 | }; |
| 210 | }; |
| 211 | const getTweenObjectColorSetter = ( |
| 212 | object: IColorable, |
| 213 | useHSLColorTransition: boolean |
| 214 | ) => { |
| 215 | if (useHSLColorTransition) { |
| 216 | return ([hue, saturation, lightness]: number[]) => { |
| 217 | const rgbFromHslColor = gdjs.evtTools.tween.hslToRgb( |
| 218 | hue, |
| 219 | saturation, |
| 220 | lightness |
| 221 | ); |
| 222 | object.setColor( |
| 223 | Math.floor(rgbFromHslColor[0]) + |
| 224 | ';' + |
| 225 | Math.floor(rgbFromHslColor[1]) + |
| 226 | ';' + |
| 227 | Math.floor(rgbFromHslColor[2]) |
| 228 | ); |
| 229 | }; |
| 230 | } else { |
| 231 | return ([red, green, blue]: number[]) => { |
| 232 | object.setColor( |
| 233 | Math.floor(red) + ';' + Math.floor(green) + ';' + Math.floor(blue) |
| 234 | ); |
| 235 | }; |
| 236 | } |
| 237 | }; |
| 238 | const getTweenObjectColorHSLSetter = (object: IColorable) => { |
| 239 | return ([hue, saturation, lightness]: number[]) => { |
| 240 | const rgbFromHslColor = gdjs.evtTools.tween.hslToRgb( |
no test coverage detected