MCPcopy Index your code
hub / github.com/davidmerfield/randomColor / pickBrightness

Function pickBrightness

randomColor.js:177–197  ·  view source on GitHub ↗
(H, S, options)

Source from the content-addressed store, hash-verified

175 }
176
177 function pickBrightness(H, S, options) {
178 var bMin = getMinimumBrightness(H, S),
179 bMax = 100;
180
181 switch (options.luminosity) {
182 case "dark":
183 bMax = bMin + 20;
184 break;
185
186 case "light":
187 bMin = (bMax + bMin) / 2;
188 break;
189
190 case "random":
191 bMin = 0;
192 bMax = 100;
193 break;
194 }
195
196 return randomWithin([bMin, bMax]);
197 }
198
199 function setFormat(hsv, options) {
200 switch (options.format) {

Callers 1

randomColorFunction · 0.85

Calls 2

getMinimumBrightnessFunction · 0.85
randomWithinFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…