Raised This Month: $32 Target: $400
 8% 

Colors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 02-04-2009 , 10:56   Colors
Reply With Quote #1

Update v1.3
I decided to add support all ways of saving color i know.

name (english name of color, fe. 'red')
hex #RRGGBB
dec RRRGGGBBB (3chars color value require, 12->012)
dec(2) RRR GGG BBB

Code:
---------
It helps in work with colors.
Default support dec&hexRGB colors, but when you call colors_init() can convert names*1 too.

From different ways of showing color gets array of RGB colors 

    new iColor[3]={R, G, B}

for plugin configuration.


Functions:
---------------------------------------------------------
get_full_color(const color[], iColor[3]) 
    - main function of .inc

    get_full_color("#FFFFFF",iColor); //iColor={255,255,255}
    get_full_color("white",iColor); //iColor={255,255,255}
    get_full_color("255255255",iColor); //iColor={255,255,255}    
    get_full_color("255 255 255",iColor); //iColor={255,255,255}
    
    get_full_color("255 25 255",iColor); //iColor={255,25,255}

---------------------------------------------------------
get_color(const color[],ColorsP:type) 
    - work with hexRGB or named color
    - type is one from list:
    enum ColorsP
    {
        R=1, // Red
        G, // Green
        B // Blue
    }
---------------------------------------------------------

*1 please check configs/colors.ini

---------
Attached Files
File Type: zip colors_v1.3.zip (4.2 KB, 386 views)
File Type: sma Get Plugin or Get Source (example.sma - 1108 views - 674 Bytes)

Last edited by Scherzo; 06-22-2009 at 09:51.
Scherzo is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-04-2009 , 11:18   Re: Colors
Reply With Quote #2

You might consider using an enum for R/G/B instead of 1/2/3. That way, you could also tag it so it's more understandable.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 02-04-2009 , 11:29   Re: Colors
Reply With Quote #3

Sure, thanks. Updated

Last edited by Scherzo; 02-04-2009 at 11:40.
Scherzo is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-04-2009 , 11:54   Re: Colors
Reply With Quote #4

Please upload using ZIP format to avoid issues
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-04-2009 , 12:24   Re: Colors
Reply With Quote #5

thats nice! GJ!
__________________
xPaw is offline
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 04-02-2009 , 15:56   Re: Colors
Reply With Quote #6

v1.2
new function and little optimalized
Scherzo is offline
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 06-22-2009 , 09:44   Re: Colors
Reply With Quote #7

Update v1.3

Example added.

Last edited by Scherzo; 06-22-2009 at 09:52.
Scherzo is offline
[MSI] Creator
Member
Join Date: Jul 2009
Location: Bulgaria
Old 07-10-2009 , 10:17   Re: Colors
Reply With Quote #8

this is not finishet
[MSI] Creator is offline
Send a message via Skype™ to [MSI] Creator
Old 07-10-2009, 17:26
[ --<-@ ] Black Rose
This message has been deleted by [ --<-@ ] Black Rose. Reason: Didn't notice it was old.
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 07-16-2009 , 06:22   Re: Colors
Reply With Quote #9

Quote:
Originally Posted by [MSI] Creator View Post
this is not finishet
Hmm?
Scherzo is offline
Shard
Member
Join Date: Mar 2009
Old 09-02-2009 , 13:15   Re: Colors
Reply With Quote #10

Thanks! Finally, im able to get the code for teal
Shard 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 10:38.


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