문제

I have a colour scheme based around yellow, for warning messages on a website. It amounts to a slightly orange bordered box, with a pale yellow fill. The exact colours are:

  • FED626 (border)

  • FFF7C0 (fill)

I want to know if it's possible to convert this scheme mathematically or algorithmically somehow, to come up with a blue version where the border is the "same amount" of blue as this one is yellow. Is this possible, or do I just "pin the tail on the donkey" on a colour pallet to get roughly the right one?

I ask, because I'd quite like to be able to calculate this on the fly, to perhaps implement something in .less.

To give you an idea, I tried swopping the red and blue values on those two, and came up with this:

  • 26D6FE (border)

  • C0F7FF (fill)

That wasn't too hard, but think about if I wanted a pink colour scheme... :)

도움이 되었습니까?

해결책

Actually, I just read part of the the HSL and HSV page on Wikipedia, and realise that all I need to do is pick a colour, then change the Hue value to rotate to a colour I want.

Easy, now I'm a graphics expert!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top