[Include] [INC] color.inc
#1

About:

color.inc is a function library filled with colour manipulating functions. It includes a lot of smaller functions as a base for creating your own larger functions. It also includes color defines for the web colours (if you'd like to overwrite these colours then define them BEFORE the #include <color> line).

Function List


FunctionDescription
__________________________________________________ ________________________________________________
setRed(color, red)Returns the specified colour with the specified RED intensity.
setGreen(color, green)Returns the specified colour with the specified GREEN intensity.
setBlue(color, blue)Returns the specified colour with the specified BLUE intensity.
setAlpha(color, alpha)Returns the specified colour with the specified ALPHA intensity.
__________________________________________________ ________________________________________________
stripRed(color)Returns the specified colour with all RED stripped from it (0x00XXXXXX).
stripGreen(color)Returns the specified colour with all GREEN stripped from it (0xXX00XXXX).
stripBlue(color)Returns the specified colour with all BLUE stripped from it (0xXXXX00XX).
stripAlpha(color)Returns the specified colour with all ALPHA stripped from it (0xXXXXXX00).
__________________________________________________ ________________________________________________
fillRed(color)Returns the specified colour with filled RED (0xFFXXXXXX).
fillGreen(color)Returns the specified colour with filled GREEN (0xXXFFXXXX).
fillBlue(color)Returns the specified colour with filled BLUE (0xXXXXFFXX).
fillAlpha(color)Returns the specified colour with filled ALPHA (0xXXXXXXFF).
__________________________________________________ ________________________________________________
getRed(color)Returns the intensity of RED from the specified colour.
getGreen(color)Returns the intensity of GREEN from the specified colour.
getBlue(color)Returns the intensity of BLUE from the specified colour.
getAlpha(color)Returns the intensity of ALPHA from the specified colour.
__________________________________________________ ________________________________________________
makeColor(red, green, blue, alpha)Returns a new colour with the specified intensities.
setColor(color, red, green, blue, alpha)Returns an edited version of the specified colour with the specfied intensities. Use the NO_SET define to leave an intensity as it is. Note 1


Colour List:

This is a list of colour names defined inside the include, if you define your own colour with the same name before these then your colour will be the one that is used.

_COLOR_BLACK
_COLOR_NAVY
_COLOR_BLUE
_COLOR_GREEN
_COLOR_TEAL
_COLOR_LIME
_COLOR_AQUA
_COLOR_CYAN
_COLOR_MAROON
_COLOR_PURPLE
_COLOR_OLIVE
_COLOR_GRAY
_COLOR_GREY
_COLOR_SILVER
_COLOR_RED
_COLOR_FUCHSIA
_COLOR_PINK
_COLOR_YELLOW
_COLOR_WHITE

Notes:

Note 1: Usage of the setColor function can be demonstrated like this:

pawn Код:
new Color = 0xAABBCCDD;
Color = setColor( Color, 0xFF, 0x00, NO_SET, 0xEE ); // This will set the colour to 0xFF00CCEE (leaving the CC (blue intensity) from the original colour in place).
Note 2: Colour intensities can go from 0 (same as 0x00) to 255 (same as 0xFF).

Note 3: This has been tested but obviously not for every colour (and testing was limited due to %x not formatting correctly with larger numbers, functions were tested on a bitwise calculator though). If you do find a bug with it then please post the code you're using and the effect you think is bad and I'll look into it.

Download:

Reply
#2

Wow awesome release Simon, but I won't use it

This would probally be good for /setcolor commands etc.
Reply
#3

You spelt colour wrong :P
[me=Boylett]hides[/me]
Reply
#4

Wow good one simon, i'll be using it!
Reply
#5

Quote:
Originally Posted by Boylett
You spelt colour wrong :P
[me=Boylett]hides[/me]
I used 'color', because it seems that coding languages use 'color' instead of 'colour'. Just trying to keep it consistent for scripters :P.
Reply
#6

Quote:
Originally Posted by Simon
Quote:
Originally Posted by Boylett
You spelt colour wrong :P
[me=Boylett]hides[/me]
I used 'color', because it seems that coding languages use 'color' instead of 'colour'. Just trying to keep it consistent for scripters :P.
Silly Boylett[me=Mikep]hides[/me]
Reply
#7

Quote:
Originally Posted by Boylett
You spelt colour wrong :P
[me=Boylett]hides[/me]
I think color is the American way of spelling it
Reply
#8

English American

Humour Humor
Colour Color
etc.

We have u's but I prefer to use color anyway, it's faster to type.
Reply
#9

color = English American
colour = English British

Teachers told us that in school
Reply
#10

Are you stupid? Look at the fucking date of the last post. God.
Reply
#11

Please re-upload at Pastebin. I can't donwload from Solidfiles, it says Forbidden.
Reply
#12

Here, i've uploaded my copy. http://pastebin.com/yY2DRprH
Reply
#13

Please I need this INC to run an old script, re-upload.
Reply
#14

Quote:
Originally Posted by Jentebo
Посмотреть сообщение
Please I need this INC to run an old script, re-upload.
Pastebin link >> https://pastebin.com/5Z6uVuWb
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)