glimmer-dsl-libui 0.2.23 → 0.2.24

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e33c97761bce7909c5a48df2689cb8bd0a4745ac68a24c814c4938c36eb08e0
4
- data.tar.gz: 604b2d6439ed510f6e30bae8f431c09fcd348f14afa71fa4707a3de0d71cae33
3
+ metadata.gz: a9b4b92bdc276153bae236387b4813b62bc1b8b9f5b6779c59ffae9b1b47484f
4
+ data.tar.gz: 69efbe44dac5e3fec15ec31c261b469187a45d8acabf2d9754459f1bbfbc66d7
5
5
  SHA512:
6
- metadata.gz: 66603e770e6135e08ea785ef46ac9158c6f14b1c3966175c7116f9a81cc3dbbfcc2ee495f16d367976174b2f8f0d9013640731713db3c9be65dd5b973dba12b5
7
- data.tar.gz: 94ca555082c61042dd24ba0a36b75b5b401b8c63ef0c0f5acff6b3fcb2f822dd37e61ab3cd3660b5e657896a8209afe09760cf8c7fc9a092d00a6666d43a1c96
6
+ metadata.gz: 39ef3e3f8db68098d52222ef7ffa3ed5f9d85e25199ed960d9945e2f92a13bd90cdfc860fcd5fd901a6b76d3899786ef9363fad131d7bc25880506b4355ef2dd
7
+ data.tar.gz: 0f92e07ed0e37bfc7e172b275d57853b26407b9f708554d586a4b6b97460485926217f364cad5cfdf3b016a37366acd51dbf440004709909f5d9cf924a8d7734
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.2.24
4
+
5
+ - Support hex colors as `String` with `'#'` prefix (e.g. '#ffaa92')
6
+
3
7
  ## 0.2.23
4
8
 
5
9
  - Improve examples/tetris.rb by having high score dialog pause the game if running and resume after closed
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for LibUI 0.2.23
1
+ # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for LibUI 0.2.24
2
2
  ## Prerequisite-Free Ruby Desktop Development GUI Library
3
3
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-libui.svg)](http://badge.fury.io/rb/glimmer-dsl-libui)
4
4
  [![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
@@ -373,7 +373,7 @@ gem install glimmer-dsl-libui
373
373
  Or install via Bundler `Gemfile`:
374
374
 
375
375
  ```ruby
376
- gem 'glimmer-dsl-libui', '~> 0.2.23'
376
+ gem 'glimmer-dsl-libui', '~> 0.2.24'
377
377
  ```
378
378
 
379
379
  Add `require 'glimmer-dsl-libui'` at the top, and then `include Glimmer` into the top-level main object for testing or into an actual class for serious usage.
@@ -552,8 +552,8 @@ There are additional useful `Glimmer::LibUI` operations that are not found in `L
552
552
  - `Glimmer::LibUI::integer_to_boolean(int, allow_nil: true)`
553
553
  - `Glimmer::LibUI::boolean_to_integer(int, allow_nil: true)`
554
554
  - `Glimmer::LibUI::degrees_to_radians(degrees)`
555
- - `Glimmer::LibUI::interpret_color(value)`: interprets a color in any form like `String`, `Symbol`, or hex into an rgb `Hash`
556
- - `Glimmer::LibUI::hex_to_rgb(value)`: converts a hex color to an rgb `Hash`
555
+ - `Glimmer::LibUI::interpret_color(value)`: interprets a color in any form like `String`, `Symbol`, or hex into an rgb `Hash` (including `0x1f3b5d`, `'0x1f3b5d'`, `'#1f3b5d'`, and 3-char hex-shorthand variations)
556
+ - `Glimmer::LibUI::hex_to_rgb(value)`: converts a hex color to an rgb `Hash` (including `0x1f3b5d`, `'0x1f3b5d'`, `'#1f3b5d'`, and 3-char hex-shorthand variations)
557
557
  - `Glimmer::LibUI::enum_names`: provides all possible enum names to use with `Glimmer::LibUI::enum_symbols(enum_name)`
558
558
  - `Glimmer::LibUI::enum_symbols(enum_name)`: returns all possible values for an enum. `enum_name` can be:
559
559
  - `:draw_brush_type`: `[:solid, :linear_gradient, :radial_gradient, :image]`
@@ -901,9 +901,11 @@ transform m1
901
901
  # and then reuse m1 elsewhere too
902
902
  ```
903
903
 
904
+ You can set a `matrix`/`transform` on `area` directly to conveniently apply to all nested `path`s too.
905
+
904
906
  Note that `area`, `path`, and nested shapes are all truly declarative, meaning they do not care about the ordering of calls to `fill`, `stroke`, and `transform`. Furthermore, any transform that is applied is reversed at the end of the block, so you never have to worry about the ordering of `transform` calls among different paths. You simply set a transform on the `path`s that need it and it is guaranteed to be called before all its content is drawn, and then undone afterwards to avoid affecting later paths. Matrix `transform` can be set on an entire `area` too, applying to all nested `path`s.
905
907
 
906
- `fill` and `stroke` accept [X11](https://en.wikipedia.org/wiki/X11_color_names) color `Symbol`s/`String`s like `:skyblue` and `'sandybrown'` or 6-number hex or 3-number hex-shorthand (as `Integer` or `String` with or without `0x` prefix)
908
+ `fill` and `stroke` accept [X11](https://en.wikipedia.org/wiki/X11_color_names) color `Symbol`s/`String`s like `:skyblue` and `'sandybrown'` or 6-char hex or 3-char hex-shorthand (as `Integer` or `String` with or without `0x` prefix)
907
909
 
908
910
  Available [X11 colors](https://en.wikipedia.org/wiki/X11_color_names) can be obtained through `Glimmer::LibUI.x11_colors` method.
909
911
 
@@ -996,7 +998,7 @@ window('area text drawing') {
996
998
  - All controls are protected from garbage collection until no longer needed (explicitly destroyed), so there is no need to worry about surprises.
997
999
  - All resources are freed automatically once no longer needed or left to garbage collection.
998
1000
  - When nesting an `area` directly underneath `window` (without a layout control like `vertical_box`), it is automatically reparented with `vertical_box` in between the `window` and `area` since it would not show up on Linux otherwise.
999
- - Colors may be passed in as a hash of `:r`, `:g`, `:b`, `:a`, or `:red`, `:green`, `:blue`, `:alpha`, or [X11](https://en.wikipedia.org/wiki/X11_color_names) color like `:skyblue`, or 6-number hex or 3-number hex (as `Integer` or `String` with or without `0x` prefix)
1001
+ - Colors may be passed in as a hash of `:r`, `:g`, `:b`, `:a`, or `:red`, `:green`, `:blue`, `:alpha`, or [X11](https://en.wikipedia.org/wiki/X11_color_names) color like `:skyblue`, or 6-char hex or 3-char hex (as `Integer` or `String` with or without `0x` prefix)
1000
1002
  - Color alpha value defaults to `1.0` when not specified.
1001
1003
 
1002
1004
  ### Custom Keywords
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.23
1
+ 0.2.24
Binary file
data/lib/glimmer/libui.rb CHANGED
@@ -83,6 +83,7 @@ module Glimmer
83
83
  value = value.chars.map {|char| [char, char]}.flatten.join if value.length == 3
84
84
  value = "0x#{value}"
85
85
  end
86
+ value = "0x#{value[1..-1]}" if value.start_with?('#')
86
87
  value = value.to_i(16)
87
88
  end
88
89
  if value.is_a?(Integer)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-libui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.23
4
+ version: 0.2.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-09 00:00:00.000000000 Z
11
+ date: 2021-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glimmer