From 1ffb82af91eec4e737297948c50bfd71308c8f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Mon, 22 Jan 2024 09:37:15 +0100 Subject: [PATCH] fixed Color.fromString() parsing --- README.md | 2 +- morphic.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 858b926..6615f63 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ inspired by Squeak written by Jens Mönig jens@moenig.org -Copyright (C) 2010-2023 by Jens Mönig +Copyright (C) 2010-2024 by Jens Mönig Morphic.js is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/morphic.js b/morphic.js index cbfd6e4..4ab1252 100644 --- a/morphic.js +++ b/morphic.js @@ -8,7 +8,7 @@ written by Jens Mönig jens@moenig.org - Copyright (C) 2010-2023 by Jens Mönig + Copyright (C) 2010-2024 by Jens Mönig This file is part of Snap!. @@ -1306,7 +1306,7 @@ /*jshint esversion: 11, bitwise: false*/ -var morphicVersion = '2023-November-07'; +var morphicVersion = '2024-January-22'; var modules = {}; // keep track of additional loaded modules var useBlurredShadows = true; @@ -2130,8 +2130,8 @@ Color.prototype.toRGBstring = function () { Color.fromString = function (aString) { // I parse rgb/rgba strings into a Color object - var components = aString.split(/[\(),]/).slice(1,5); - return new Color(components[0], components[1], components[2], components[3]); + var channels = aString.split(/[\(),]/).slice(0,4); + return new Color(+channels[0], +channels[1], +channels[2], +channels[3]); }; // Color copying: