1. How do you define a custom color [LINUX}

-- from std/graphcst.e 
 
--**** 
-- === Routines 
 
--** 
-- Mixture Type 
-- 
-- Comments: 
-- 
-- A mixture is a ##{red, green, blue}## triple of intensities, which enables you to define 
-- custom colors. Intensities must be from 0 (weakest) to 63 (strongest). Thus, the brightest 
-- white is ##{63, 63, 63}##. 
 
public type mixture(object s) 
	if atom(s) then 
		return 0 
	end if 
	 
	if length(s) != 3 then 
		return 0 
	end if 
	 
	for i=1 to 3 do 
		if not integer(s[i]) then 
			return 0 
		end if 
  		if and_bits(s[i],#FFFFFFC0) then 
  			return 0 
  		end if 
	end for 
	return 1 
end type 

I haven't got a clue as to how to use this type. I suspect that it might be an old dos routine to be used with a function called pallete.

Can custom colors be defined in Euphoria/LINUX?

Regards,
Ken

new topic     » topic index » view message » categorize

2. Re: How do you define a custom color [LINUX}

Senator said...

I haven't got a clue as to how to use this type. I suspect that it might be an old dos routine to be used with a function called pallete.

I believe you are correct. From what I can tell, anything that wasn't strictly related to DOS graphics was left in when DOS support was removed, but things like this turn into vestigial useless remnants that should have been removed in a second post-DOS-removal sweep of the standard library.

Senator said...

Can custom colors be defined in Euphoria/LINUX?

AFAICT no, shell supports the standard 16 colors and those can be overridden by the terminal emulator to make things prettier, but you're still stuck with the same color codes: https://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/

-Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: How do you define a custom color [LINUX}

Ok.......

Thanks for all the information, Greg.

Regards, Ken

new topic     » goto parent     » topic index » view message » categorize

4. Re: How do you define a custom color [LINUX}

Senator said...

Ok.......

Thanks for all the information, Greg.

Curious, what are you trying to do?

-Greg

new topic     » goto parent     » topic index » view message » categorize

5. Re: How do you define a custom color [LINUX}

Well actually, you can do anything:

If you are talking about a console, then text_color()/bk_color() are limited to the 16 predefined ones but (as per phix\builtins\VM\pfileioN.e/set_console_colour() - which could fairly easily be ported to Euphoria) you can always wrap kernel32/SetConsoleTextAttribute on windows or printf(1"\E[%d;%dm", {bold,color}) on Linux. You would probably gain very little though, if indeed anything.

If you are talking about a gui lib, each will have it's own mechanism, eg pGUI supports #AARRGGBB formats and has an atom color = rgb(atom red, green, blue, alpha=0) routine, in other words that is 16 million colours, and each of those ranging from completely opaque to completely transparent.

As said though, some/most of the ancient DOS palette and bitmap handling stuff is either dead in the water or pretty close to it, and quite rightly so.

Pete

new topic     » goto parent     » topic index » view message » categorize

6. Re: How do you define a custom color [LINUX}

ghaberek said...
Senator said...

Ok.......

Thanks for all the information, Greg.

Curious, what are you trying to do?

-Greg

I liked some of background/foreground color options available on the gnome-terminal and when I noticed the mixture type I thought I might be able to configure the Euphoria's 16 available colors with a little more pizzazz.

Regards, Ken

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu