TextEdit (Lion) - color text

Did something change in Lion. Before using rgb with 3 digit rgb worked now it takes 5?

copy this text to textedit:

use this script

tell application "TextEdit"
	tell text of document 1 --(or front document)
		set the color of every word where it is "color1" to {60000, 0, 0}
		set the color of every word where it is "color2" to {255, 0, 0}
	end tell
end tell

expected results:
both color1, color2 text should turn red

only color1 turns red


It’s the same in Snow Leopard and Tiger. What were you using before?

Hmm snow leopard. Maybe my understanding of RGB is incorrect since i assumed it was 255 at its max with 3 digits but it seems you can exceed that. (assumption based on photoshop color selector)

The maximum is 65535 ” 16-bit values rather than 8-bit.

could you please recommend a tool to help define 16bit color?

I don’t know about tools, but if you know the 8-bit values ” eg. as per the Mac OS colour-picker’s RGB sliders ” the conversion formula (for TextEdit, at least) appears to be to multiply by 257.

thanks that simplifies it greatly. Appreciate it