Class: LSP::Color
Overview
export interface Color
/**
* The red component of this color in the range [0-1].
*/
readonly red: number;
/**
* The green component of this color in the range [0-1].
*/
readonly green: number;
/**
* The blue component of this color in the range [0-1].
*/
readonly blue: number;
/**
* The alpha component of this color in the range [0-1].
*/
readonly alpha: number;
Instance Attribute Summary collapse
-
#alpha ⇒ Object
type: number # type: number # type: number # type: number.
-
#blue ⇒ Object
type: number # type: number # type: number # type: number.
-
#green ⇒ Object
type: number # type: number # type: number # type: number.
-
#red ⇒ Object
type: number # type: number # type: number # type: number.
Instance Method Summary collapse
Methods inherited from LSPBase
Constructor Details
This class inherits a constructor from LSP::LSPBase
Instance Attribute Details
#alpha ⇒ Object
type: number # type: number # type: number # type: number
137 138 139 |
# File 'lib/lsp/lsp_types.rb', line 137 def alpha @alpha end |
#blue ⇒ Object
type: number # type: number # type: number # type: number
137 138 139 |
# File 'lib/lsp/lsp_types.rb', line 137 def blue @blue end |
#green ⇒ Object
type: number # type: number # type: number # type: number
137 138 139 |
# File 'lib/lsp/lsp_types.rb', line 137 def green @green end |
#red ⇒ Object
type: number # type: number # type: number # type: number
137 138 139 |
# File 'lib/lsp/lsp_types.rb', line 137 def red @red end |
Instance Method Details
#from_h!(value) ⇒ Object
139 140 141 142 143 144 145 146 |
# File 'lib/lsp/lsp_types.rb', line 139 def from_h!(value) value = {} if value.nil? self.red = value['red'] self.green = value['green'] self.blue = value['blue'] self.alpha = value['alpha'] self end |