|
@@ 60-71 (lines=12) @@
|
| 57 |
|
* @param bool|null $is_dark Whether or not to treat the base color as a dark color. Leave as null to dynamically generate this. |
| 58 |
|
* @return array An array of 5 complementary colors where the first offset is the original input. |
| 59 |
|
*/ |
| 60 |
|
public static function complementary_set (float $h = 0.0, float $s = 0.0, float $l = 0.0, $is_dark = NULL) :array { |
| 61 |
|
static::is_dark($is_dark, $h, $s, $l); |
| 62 |
|
$al = static::alt_light($l); |
| 63 |
|
$as = static::alt_saturation($s); |
| 64 |
|
return static::_assign_keys([ |
| 65 |
|
[$h, $s, $l], |
| 66 |
|
[$h, $as, static::mod($al, 20, $is_dark)], |
| 67 |
|
[$h, $as, static::mod($al, 10, $is_dark)], |
| 68 |
|
[static::mod($h, 185, TRUE, 360), $as, $al], |
| 69 |
|
[static::mod($h, 185, TRUE, 360), $as, static::mod($al, 10, $is_dark)] |
| 70 |
|
]); |
| 71 |
|
} |
| 72 |
|
|
| 73 |
|
/** |
| 74 |
|
* These colors use mathematical offsets that usually complement each other |
|
@@ 166-177 (lines=12) @@
|
| 163 |
|
* @param bool|null $is_dark Whether or not to treat the base color as a dark color. Leave as null to dynamically generate this. |
| 164 |
|
* @return array An array of 5 triangular colors where the first offset is the original input. |
| 165 |
|
*/ |
| 166 |
|
public static function tetrad_set (float $h = 0.0, float $s = 0.0, float $l = 0.0, $is_dark = NULL) :array { |
| 167 |
|
static::is_dark($is_dark, $h, $s, $l); |
| 168 |
|
$al = static::alt_light($l); |
| 169 |
|
$as = static::alt_saturation($s); |
| 170 |
|
return static::_assign_keys([ |
| 171 |
|
[$h, $s, $l], |
| 172 |
|
[static::mod($h, 180, TRUE, 360), $as, $al], |
| 173 |
|
[static::mod($h, 120, TRUE, 360), $as, $al], |
| 174 |
|
[$h, $as, static::mod($al, 18, $is_dark)], |
| 175 |
|
[static::mod($h, -120, TRUE, 360), $as, $al] |
| 176 |
|
]); |
| 177 |
|
} |
| 178 |
|
|
| 179 |
|
/** |
| 180 |
|
* 3 of these colors are all similarly distanced from each other on a color |
|
@@ 191-202 (lines=12) @@
|
| 188 |
|
* @param bool|null $is_dark Whether or not to treat the base color as a dark color. Leave as null to dynamically generate this. |
| 189 |
|
* @return array An array of 5 triangular colors where the first offset is the original input. |
| 190 |
|
*/ |
| 191 |
|
public static function weighted_tetrad_set (float $h = 0.0, float $s = 0.0, float $l = 0.0, $is_dark = NULL) :array { |
| 192 |
|
static::is_dark($is_dark, $h, $s, $l); |
| 193 |
|
$al = static::alt_light($l); |
| 194 |
|
$as = static::alt_saturation($s); |
| 195 |
|
return static::_assign_keys([ |
| 196 |
|
[$h, $s, $l], |
| 197 |
|
[static::mod($h, 160, TRUE, 360), $as, $al], |
| 198 |
|
[static::mod($h, 80, TRUE, 360), $as, $al], |
| 199 |
|
[$h, $as, static::mod($al, 18, $is_dark)], |
| 200 |
|
[static::mod($h, -80, TRUE, 360), $as, $al] |
| 201 |
|
]); |
| 202 |
|
} |
| 203 |
|
|
| 204 |
|
/** |
| 205 |
|
* These colors are all equally distanced from each other on a color wheel, |
|
@@ 214-225 (lines=12) @@
|
| 211 |
|
* @param bool|null $is_dark Whether or not to treat the base color as a dark color. Leave as null to dynamically generate this. |
| 212 |
|
* @return array An array of 5 triangular colors where the first offset is the original input. |
| 213 |
|
*/ |
| 214 |
|
public static function triad_set (float $h = 0.0, float $s = 0.0, float $l = 0.0, $is_dark = NULL) :array { |
| 215 |
|
static::is_dark($is_dark, $h, $s, $l); |
| 216 |
|
$al = static::alt_light($l); |
| 217 |
|
$as = static::alt_saturation($s); |
| 218 |
|
return static::_assign_keys([ |
| 219 |
|
[$h, $s, $l], |
| 220 |
|
[static::mod($h, 120, TRUE, 360), $as, $al], |
| 221 |
|
[$h, $as, static::mod($al, 18, $is_dark)], |
| 222 |
|
[static::mod($h, -120, TRUE, 360), $as, $al], |
| 223 |
|
[static::mod($h, -120, TRUE, 360), $as, static::mod($al, 18, $is_dark)] |
| 224 |
|
]); |
| 225 |
|
} |
| 226 |
|
|
| 227 |
|
/** |
| 228 |
|
* These colors are all similarly distanced from each other on a color wheel, |
|
@@ 238-249 (lines=12) @@
|
| 235 |
|
* @param bool|null $is_dark Whether or not to treat the base color as a dark color. Leave as null to dynamically generate this. |
| 236 |
|
* @return array An array of 5 weighted triangular colors where the first offset is the original input. |
| 237 |
|
*/ |
| 238 |
|
public static function weighted_triad_set (float $h = 0.0, float $s = 0.0, float $l = 0.0, $is_dark = NULL) :array { |
| 239 |
|
static::is_dark($is_dark, $h, $s, $l); |
| 240 |
|
$al = static::alt_light($l); |
| 241 |
|
$as = static::alt_saturation($s); |
| 242 |
|
return static::_assign_keys([ |
| 243 |
|
[$h, $s, $l], |
| 244 |
|
[static::mod($h, 80, TRUE, 360), $as, $al], |
| 245 |
|
[$h, $as, static::mod($al, 18, $is_dark)], |
| 246 |
|
[static::mod($h, -80, TRUE, 360), $as, $al], |
| 247 |
|
[static::mod($h, -80, TRUE, 360), $as, static::mod($al, 18, $is_dark)] |
| 248 |
|
]); |
| 249 |
|
} |
| 250 |
|
|
| 251 |
|
/** |
| 252 |
|
* 4 of these colors form a rectangle on a color wheel, and 1 color is an |
|
@@ 261-272 (lines=12) @@
|
| 258 |
|
* @param bool|null $is_dark Whether or not to treat the base color as a dark color. Leave as null to dynamically generate this. |
| 259 |
|
* @return array An array of 5 rectangular colors where the first offset is the original input. |
| 260 |
|
*/ |
| 261 |
|
public static function rectangular_set (float $h = 0.0, float $s = 0.0, float $l = 0.0, $is_dark = NULL) :array { |
| 262 |
|
static::is_dark($is_dark, $h, $s, $l); |
| 263 |
|
$al = static::alt_light($l); |
| 264 |
|
$as = static::alt_saturation($s); |
| 265 |
|
return static::_assign_keys([ |
| 266 |
|
[$h, $s, $l], |
| 267 |
|
[static::mod($h, 216, TRUE, 360), $as, $al], |
| 268 |
|
[static::mod($h, 180, TRUE, 360), $as, $al], |
| 269 |
|
[$h, $as, static::mod($al, 18, $is_dark)], |
| 270 |
|
[static::mod($h, 36, TRUE, 360), $as, $al] |
| 271 |
|
]); |
| 272 |
|
} |
| 273 |
|
|
| 274 |
|
/** |
| 275 |
|
* Assigns keys to a hsl scheme array |