15,913,854 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by wf0007 (Top 7 by date)
wf0007
26-Nov-13 21:19pm
View
Deleted
When I get the HSL int array and I put HSL array to HSL2RGB method to get the RGB color value, but I found the value is different from the value put the TestInt method and RGB2HSL method to get the HSL array.
wf0007
26-Nov-13 21:13pm
View
Deleted
Please see the code below: I put the IntRgb array to this method and get another int array to show the HSL but I can not get the right color through these methods, I will put the HSL2RGB method at the end.
public static int[] RGB2HSL( int[] rgb)
{
double R = rgb[0]/255d;
double G = rgb[1]/255d;
double B = rgb[2]/255d;
double H = 0d;
double S = 0d;
double L = 0d;
double v;
double m;
double vm;
double R2, G2, B2;
v = Math.max(Math.max(R,G),B );
m = Math.min( Math.min(R,G), B);
L = (m+v)/2.0;
vm = v-m;
S = vm;
if ( S > 0 )
{
if( L <= 0.5 )
S = S/(v+m);
else
S = S/(2.0 -v -m);
R2 = (v-R)/vm;
G2 = (v-G)/vm;
B2 = (v-B)/vm;
if ( R==v)
{
if( G == m )
H = 5.0 + B2;
else
H = 1.0 - G2;
}
else
if ( G == v )
{
if ( B == m )
H = 1.0 + R2;
else
H = 3.0 - B2;
}
else
{
if ( R == m )
H = 3.0 + G2;
else
H = 5.0 - R2;
}
H = H/6.0;
}
return new int[] { (int)Math.round(H), (int)Math.round(S*100d), (int)Math.round(L*100d) };
}
wf0007
26-Nov-13 8:12am
View
I use this int array to convert to HSL(Hue, Saturation, Lightness), I find there are display some error value, so I need to confirm whether this method is right.
wf0007
14-Nov-13 8:12am
View
Thank you for your solution
wf0007
13-Nov-13 20:32pm
View
No,It is a web application,sorry for reply it now.
wf0007
8-Nov-13 4:23am
View
I use Canvas to make a color picker the use can get the color form it and set it to another place but now i can get the user selected color but it sometimes display red sometimes display #F2E906.
i get the value from web pages
wf0007
14-Aug-12 3:52am
View
Thank you very much, I have been with you the method to solve the problem. but I also modify
my code . I use the document.getElementById("xlist") to get the Object .The object is obtained by JQuery also tell me Object doesn't support property or method 'initOCX'.
Show More