Turing Color To Html Color
Author |
Message |
s3ven
|
Posted: Wed Jun 09, 2010 9:14 pm Post subject: Turing Color To Html Color |
|
|
What is it you are trying to achieve?
Hello, I am basically trying to convert the turing RGB color number into a format where it can be convert into html and read properly.
What is the problem you are having?
for example - Color White in turing is "0" but if i put the 0 into html code snippet it wouldn't work because html only reads hex/etc therefore not giving me the desire color.
Describe what you have tried to solve this problem
I was going to rephrase my question for the time being allowing the user to enter in the color in words: example - "red" instead of 14 or whatever
but I plan to use a color chart with my class assignment to allow the user to have more variety.
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Turing: |
var output_file : int
var name:string
var filename:string
var background:string
var colours:string
put"What would you like to save the webpage file as?"
get filename:*
filename:=filename+".html"
open : output_file, filename, put
put"Please enter your name:"
get name:*
put : output_file,name
put"Please enter the background color you would like:"
get colours
background:="<body bgcolor="
background:=background+colours+">"
put:output_file,background
|
Please specify what version of Turing you are using
I am using the latest version of turing |
|
|
|
|
|
Sponsor Sponsor
|
|
|
DtY
|
Posted: Wed Jun 09, 2010 9:21 pm Post subject: RE:Turing Color To Html Color |
|
|
There's not really any way.
That said, Turing colours are just numbers that internally map to a colour that is displayed on screen. They don't mean anything outside of Turing (just imagine, on a piece of paper, you decide that 1 will be red, 2 will be green, &c, these numbers don't mean anything outside of that paper).
However, if you draw something onto the screen of a specific colour, it will be looked up in that table, and drawn on the screen in the right colour. If you take a screenshot, you can use an image editor (or some viewers) to get the colour in a format that can be converted to an html colour code.
If you use The Gimp, you can open the image, and use the eye dropper to select a colour from the image. Once that colour is active, if you open the colour selection dialog (double click the colour swatch), there is a text box with the html colour code for that colour.
Other than that, you may be able to find one that someone else has already made. |
|
|
|
|
|
Insectoid
|
Posted: Wed Jun 09, 2010 9:22 pm Post subject: RE:Turing Color To Html Color |
|
|
Turing actually has an RGB module that you can access to create hex colors
Something like RGB.addcolor (#FFFFFF). I don't remember the exact syntax, look it up in the F10 help.
EDIT: Sneaky bastard, you beat me! |
|
|
|
|
|
|
|