芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/xmintal-back/vendor/fakerphp/faker/src/Faker/Core/Color.php
numberBetween(1, 16777215)), 6, '0', STR_PAD_LEFT); } /** * @example '#ff0044' */ public function safeHexColor(): string { $number = new Number(); $color = str_pad(dechex($number->numberBetween(0, 255)), 3, '0', STR_PAD_LEFT); return sprintf( '#%s%s%s%s%s%s', $color[0], $color[0], $color[1], $color[1], $color[2], $color[2] ); } /** * @example 'array(0,255,122)' * * @return int[] */ public function rgbColorAsArray(): array { $color = $this->hexColor(); return [ hexdec(substr($color, 1, 2)), hexdec(substr($color, 3, 2)), hexdec(substr($color, 5, 2)), ]; } /** * @example '0,255,122' */ public function rgbColor(): string { return implode(',', $this->rgbColorAsArray()); } /** * @example 'rgb(0,255,122)' */ public function rgbCssColor(): string { return sprintf( 'rgb(%s)', $this->rgbColor() ); } /** * @example 'rgba(0,255,122,0.8)' */ public function rgbaCssColor(): string { $number = new Number(); return sprintf( 'rgba(%s,%s)', $this->rgbColor(), $number->randomFloat(1, 0, 1) ); } /** * @example 'blue' */ public function safeColorName(): string { return Helper::randomElement($this->safeColorNames); } /** * @example 'NavajoWhite' */ public function colorName(): string { return Helper::randomElement($this->allColorNames); } /** * @example '340,50,20' */ public function hslColor(): string { $number = new Number(); return sprintf( '%s,%s,%s', $number->numberBetween(0, 360), $number->numberBetween(0, 100), $number->numberBetween(0, 100) ); } /** * @example array(340, 50, 20) * * @return int[] */ public function hslColorAsArray(): array { $number = new Number(); return [ $number->numberBetween(0, 360), $number->numberBetween(0, 100), $number->numberBetween(0, 100), ]; } }