Recent

Author Topic: CPickSniff - a color picker and sniffer  (Read 17136 times)

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
CPickSniff - a color picker and sniffer
« on: September 25, 2010, 07:39:24 pm »
Hello all :)
I have published the first tool i made in Lazarus, it's a color picker that can take a color on the screen.
It will show you both decimal and hexadecimal color code. You can also type a color code and press enter.

I made it for windows and ubuntu (gtk2).

You can see screenshots and download it here:

http://fabienwang.com/projects/cpicksniff
« Last Edit: December 06, 2010, 12:54:42 am by FabienWang »
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: CPickSniff - a color picker and sniffer
« Reply #1 on: September 25, 2010, 08:41:09 pm »
Crazy people are usually have good ideas.
« Last Edit: September 25, 2010, 11:43:15 pm by typo »

captian jaster

  • Guest
Re: CPickSniff - a color picker and sniffer
« Reply #2 on: September 26, 2010, 12:20:09 am »
Neat......
I never would of thought of this....
 ;D

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: CPickSniff - a color picker and sniffer
« Reply #3 on: September 26, 2010, 04:31:50 am »
All OS should have such a tool.

Inspired on this idea, I have made my own, which can be downloaded from http://www.lazarusbrasil.org/GetColor.zip

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: CPickSniff - a color picker and sniffer
« Reply #4 on: September 26, 2010, 05:58:05 am »
I will not steal your idea.

Moreover, I put a link to your tool on this page: http://lazarusbrasil.org/
« Last Edit: September 26, 2010, 06:18:03 am by typo »

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: CPickSniff - a color picker and sniffer
« Reply #5 on: September 26, 2010, 07:19:38 am »
Hey thanks for all

I didn't really understand wuchun. If you're talking about choices in the program, i have tested many other tools and i wanted mine be the simplest possible :) that's why there's no HSL or other things.
Btw i got a bug in the HSL values so i removed it.
http://www.lazarus.freepascal.org/index.php/topic,10309.0.html

typo, your tool is great you get the transparency of the color on my seven :) and thanks to you i discovered there is a DrawLineFocus or something :D (my choice to put red lines wasn't the best, especially if you have a red background ^^)
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

typo

  • Hero Member
  • *****
  • Posts: 3051

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: CPickSniff - a color picker and sniffer
« Reply #7 on: September 26, 2010, 07:29:36 am »
yeah i used already this one but totally forgot we could create a flat rectangle so it's a line :<
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: CPickSniff - a color picker and sniffer
« Reply #8 on: September 26, 2010, 07:38:25 am »
I have used this function to RGB:

Code: [Select]
type
  RGBColor = record
    Red :integer;
    Green :integer;
    Blue :integer;
end;

function FindRGB(Color: TColor): RGBColor;
var
  R,G,B : Integer;
begin
  R := Color and $ff;
  G := (Color and $ff00) shr 8;
  B := (Color and $ff0000) shr 16;
  Result.Red := R;
  Result.Green := G;
  Result.Blue := B;
end;       

eny

  • Hero Member
  • *****
  • Posts: 1648
Re: CPickSniff - a color picker and sniffer
« Reply #9 on: September 26, 2010, 12:22:09 pm »
I have used this function to RGB: ...
From a purist's point of view: you don't acutally need the 3 local vars   ;)
All posts based on: Win10 (Win64); Lazarus 3_4  (x64) 25-05-2024 (unless specified otherwise...)

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: CPickSniff - a color picker and sniffer
« Reply #10 on: September 26, 2010, 05:33:44 pm »
Code: [Select]
function FindRGB(Color: TColor): RGBColor;
begin
  Result.Red := Color and $ff;
  Result.Green := (Color and $ff00) shr 8;
  Result.Blue := (Color and $ff0000) shr 16;
end;

Yes. I have adapted this function from another use.
« Last Edit: September 26, 2010, 07:28:16 pm by typo »

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: CPickSniff - a color picker and sniffer
« Reply #11 on: September 29, 2010, 08:59:57 pm »
I would like to thank you all.
My color picker has been downloaded 68 times in 5 days i'm really happy.
I will continue to develop things with lazarus
and help the development and bug fixing of it.

Thanks :)
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

 

TinyPortal © 2005-2018