Raised This Month: $12 Target: $400
 3% 

[INC] Colour Manipulation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 11-10-2017 , 21:11   [INC] Colour Manipulation
Reply With Quote #1

Made a small .inc file that has some basic functions for manipulating colours and interpolating them, because interpolating in rgb is yuck.

Can convert from RGB to HSV, and HSV to RGB. Range of values for the HSV is [0,255] for all the values, not [0,100] or [0,360] which some people might be expecting.

Also included a function to do some basic linear interpolation between 2 colours, and a seperate function for interpolating between 2 HSV colours. Since the Hue value is an angle and can wrap around, it needs to be interpolated a bit differently.

Finally, functions that takes an RGB or HSV colour and convert it to the hex string, e.g. (255, 0, 0) -> "#FF0000"

Hopefully someone else whos looking for this stuff doesn't have to go through same trouble I did to get effects they're looking for.
Attached Files
File Type: inc colourmanip.inc (3.2 KB, 170 views)

Last edited by hmmmmm; 11-10-2017 at 21:16.
hmmmmm is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 12-10-2017 , 03:47   Re: [INC] Colour Manipulation
Reply With Quote #2

Thank you! I was actually working on something like this myself.
404UserNotFound is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:06.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode