Comments (8)
Hi raubarede,
Try out the following.
require 'green_shoes' Shoes.app do msg = para 'hello', stroke: green button 'new text' do msg.text = 'good bye' end end
Yes, text= do not preserve current color. Sorry, this is a spec (a restriction).
Please set the style again like this:
require 'green_shoes' Shoes.app do msg = para 'hello', stroke: green button 'new text' do msg.text = fg('good bye', green) end end
ashbb
from green_shoes.
Thank you very much,
Regis,
2011/8/23 ashbb <
[email protected]>
Hi raubarede,
Try out the following.
require 'green_shoes' Shoes.app do msg = para 'hello', stroke: green button 'new text' do msg.text = 'good bye' end endYes, text= do not preserve current color. Sorry, this is a spec (a
restriction).Please set the style again like this:
require 'green_shoes' Shoes.app do msg = para 'hello', stroke: green button 'new text' do msg.text = fg('good bye', green) end endashbb
Reply to this email directly or view it on GitHub:
#45 (comment)
__ ___ __ . __
|) | / | /__
| \ |__ > L| ./
http://regisaubarede.posterous.com/
from green_shoes.
Is this perturbate the specifications (color can be in string) :
class Shoes
class App
[[:bg, :background], [:fg, :foreground]].each do |m, tag|
define_method m do |*str|
color = str.pop
str = str.join
unless String===color # <<<
rgb = "#"+(color[0, 3].map{|e| (e*255.0).to_i}.map{|i| sprintf("%#02X", i)[-2,2]}.join)
else
rgb=color # <<<
end
"<span #{tag}='#{rgb}'>#{str}</span>"
end
end
end
end
from green_shoes.
Hi raubarede,
Yes, I think your patch works.
But there may be a rare case to show slightly different color or no color.
After add your patch, try out the following.
require 'green_shoes' Shoes.app do title fg('hello', green) title fg('hello', eval('green')) title fg('hello', 'green') end
On my Windows7, last title is shown with a slightly different color.
require 'green_shoes' Shoes.app do title fg('hello', 'indigo') end
On my Windows7, have an error: should be a color specification, not 'indigo' (GLib::Error)
ashbb
from green_shoes.
require 'green_shoes'
Shoes.app do
title 'hello', stroke: green rescue para "nok 1"
title 'hello', stroke: "green" rescue para "nok 2"
title fg('hello', green) rescue para "nok 1"
title fg('hello', eval('green')) rescue para "nok 3"
title fg('hello', "green") rescue para "nok 4"
title fg('hello', "#00DD00") rescue para "nok 5"
end
I get nok 2 and nok 4; other title are ok.
seem logic ?
2011/8/24 ashbb <
[email protected]>
Hi raubarede,
Yes, I think your patch works.
But there may be a rare case to show slightly different color or no color.
After add your patch, try out the following.require 'green_shoes' Shoes.app do title fg('hello', green) title fg('hello', eval('green')) title fg('hello', 'green') endOn my Windows7, last title is shown with a slightly different color.
require 'green_shoes' Shoes.app do title fg('hello', 'indigo') endOn my Windows7, have an error:
should be a color specification, not 'indigo' (GLib::Error)
ashbb
Reply to this email directly or view it on GitHub:
#45 (comment)
__ ___ __ . __
|) | / | /__
| \ |__ > L| ./
http://regisaubarede.posterous.com/
from green_shoes.
Umm,... did you run the above snippet after adding your patch?
I got this screenshot. All 5 titles works. But colors are slightly different.
from green_shoes.
http://regisaubarede.posterous.com/pages/color-gs
here the screenshot with this code in green-shoes :
[[:bg, :background], [:fg, :foreground]].each do |m, tag|
define_method m do |*str|
color = str.pop
str = str.join
unless String===color
rgb = color[0, 3].map{|e| (e*255.0).to_i}.map{|i|
sprintf("%#02X", i)[-2,2]}.join
else
rgb=color.gsub('#','')
end
"<span #{tag}='##{rgb}'>#{str}"
end
end
2011/8/24 ashbb <
[email protected]>
Umm,... did you run the above snippet after adding your patch?
I got this screenshot. All 5 titles
works. But colors are slightly different.Reply to this email directly or view it on GitHub:
#45 (comment)
__ ___ __ . __
|) | / | /__
| \ |__ > L| ./
http://regisaubarede.posterous.com/
from green_shoes.
Hi Regis,
I got it. You have two paches. :)
At first, you showed me this one:
[[:bg, :background], [:fg, :foreground]].each do |m, tag|
define_method m do |*str|
color = str.pop
str = str.join
unless String===color
rgb = '#' + color[0, 3].map{|e| (e*255.0).to_i}.map{|i| sprintf("%#02X", i)[-2,2]}.join
else
rgb=color
end
"#{str}"
end
end
But now you are using this slightly different one:
[[:bg, :background], [:fg, :foreground]].each do |m, tag|
define_method m do |*str|
color = str.pop
str = str.join
unless String===color
rgb = color[0, 3].map{|e| (e*255.0).to_i}.map{|i| sprintf("%#02X", i)[-2,2]}.join
else
rgb=color.gsub('#','')
end
"#{str}"
end
end
So, if you use first patch, you will get the same screenshot that I got.
ashbb
from green_shoes.
Related Issues (20)
- Pango font_cache assert when doing parallel downloads HOT 1
- Object#exit() does not implement status parameter HOT 18
- Running in scite on windows shows segmentation fault HOT 2
- button does not work in conjunction with animate? HOT 2
- win32api (LoadError) on Ubuntu 12.10 / rvm ruby-1.9.3-p385 HOT 1
- Is there any way to display data in table format. HOT 2
- flows, para's, and caption issues HOT 2
- no such file to load -- glib2.so HOT 4
- The latest cairo gem drops windows support on ruby 1.9.3 HOT 3
- Sudoku on Shoes uses a fantastic
- Error video sample
- Styles not working HOT 1
- Some elements stays in the window when switching url HOT 1
- Button can only be clicked once HOT 1
- Error raised when attempting to run a 2nd instance of a green_shoes application from another thin client
- Image method cannot be provided no parameters
- Is the project alive? HOT 2
- better built in error handling
- Ruby gem on Linux Mint 19.1
- failed to require green_shows on Windows 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from green_shoes.