Say I throw out a random color like #3080c0. What color matches it such that the two together look good? e.g. What's a good background color to #3080c0 as a foreground color?
Results 1 to 10 of 10
- 29 Mar. 2014 09:31pm #1
How do you determine what color matches another?
- 30 Mar. 2014 04:07am #2
like color schemes?
- 01 Apr. 2014 03:07am #3
I'm possibly looking for complimentary, but that site's complimentary uses 5 colors, and it doesn't quite tell how it's generated. Is the hue just shifted by like 90 or 180 or whatever it is?
- 01 Apr. 2014 05:52am #4
- 01 Apr. 2014 10:33pm #5
- Join Date
- Apr. 2013
- Location
- Minnesota
- Posts
- 1,325
- Reputation
- 114
- LCash
- 0.00
I did some research and this was a snippet i found.
Code:<?PHP FUNCTION inverseHex( $color ) { $color = TRIM($color); $prependHash = FALSE; IF(STRPOS($color,'#')!==FALSE) { $prependHash = TRUE; $color = STR_REPLACE('#',NULL,$color); } SWITCH($len=STRLEN($color)) { CASE 3: $color=PREG_REPLACE("/(.)(.)(.)/","\\1\\1\\2\\2\\3\\3",$color); CASE 6: BREAK; DEFAULT: TRIGGER_ERROR("Invalid hex length ($len). Must be (3) or (6)", E_USER_ERROR); } IF(!PREG_MATCH('/[a-f0-9]{6}/i',$color)) { $color = HTMLENTITIES($color); TRIGGER_ERROR( "Invalid hex string #$color", E_USER_ERROR ); } $r = DECHEX(255-HEXDEC(SUBSTR($color,0,2))); $r = (STRLEN($r)>1)?$r:'0'.$r; $g = DECHEX(255-HEXDEC(SUBSTR($color,2,2))); $g = (STRLEN($g)>1)?$g:'0'.$g; $b = DECHEX(255-HEXDEC(SUBSTR($color,4,2))); $b = (STRLEN($b)>1)?$b:'0'.$b; RETURN ($prependHash?'#':NULL).$r.$g.$b; } // Demo // echo inverseHex('#000000'); // #ffffff ?>
https://discord.gg/TvN6xUb ~ chat on discord pls.
- 01 Apr. 2014 11:29pm #6
da fuck is inverse. 180 away on the color wheel?
- 01 Apr. 2014 11:54pm #7
- 02 Apr. 2014 12:30am #8
What about lightness? Wouldn't you reverse it? I assume that'd just be the absolute value of 255 minus the original color's lightness.
ugh i wanted to use rgb for the math, not hsl
- 02 Apr. 2014 01:57am #9
idk #'s man
y u gotta make it about numbers
- 02 Apr. 2014 05:36am #10
Writing algorithms mang.