// eslint-disable-next-line @typescript-eslint/no-magic-numbers
private randomStringLength: number = 4;
- /** Max length of Uint8Array */
+ /** express number for rgb manipulation */
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
- private unit8Array: number = 255;
+ private colourHour: number = 10;
+
+ /** express number for rgb manipulation*/
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
+ private colourMin: number = 5;
/** Instance of the rest service @private */
private restService: RestService;
/** Service holds the router information @private */
private router: Router;
- /** Random color string generator length @private */
- // eslint-disable-next-line @typescript-eslint/no-magic-numbers
- private colorStringLength: number = 256;
-
/** Check for the root directory @private */
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
private directoryCount: number = 2;
/** Generate random string @public */
public randomString(): string {
- const chars: string = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
let result: string = '';
for (let randomStringRef: number = this.randomStringLength; randomStringRef > 0; --randomStringRef) {
- result += chars[Math.floor(Math.random() * chars.length)];
+ result += new Date().getSeconds();
}
return result;
}
/** Random RGB color code generator @public */
public generateColor(): string {
- const x: number = Math.floor(Math.random() * this.colorStringLength);
- const y: number = Math.floor(Math.random() * this.colorStringLength);
- const z: number = Math.floor(Math.random() * this.colorStringLength);
+ const x: number = Math.floor((new Date().getHours()) * this.colourHour);
+ const y: number = Math.floor((new Date().getMinutes()) * this.colourMin);
+ const z: number = Math.floor((new Date().getSeconds()) * this.colourMin);
return 'rgb(' + x + ',' + y + ',' + z + ')';
}